SVP always drain the wakeup pipe

When we have a lot of idle tasks and generate new tasks, the wakeup
pipe fills and is never drained, so OSL_ENSURE in Wakeup() starts
to fail. This simply drains the pipe on every run, which processed
an event.

Change-Id: I7b6366b2649133b63138dc77fe51508404132890
This commit is contained in:
Jan-Marek Glogowski
2017-08-22 10:51:35 +02:00
parent e485703d3e
commit cb8bfa9a32
+7 -2
View File
@@ -370,6 +370,12 @@ bool SvpSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong
DoReleaseYield(nTimeoutMS);
}
else if ( bEvent )
{
// Drain the wakeup pipe
int buffer;
while (read (m_pTimeoutFDS[0], &buffer, sizeof(buffer)) > 0);
}
return bEvent;
}
@@ -394,8 +400,7 @@ void SvpSalInstance::DoReleaseYield( int nTimeoutMS )
if( (aPoll.revents & POLLIN) != 0 )
{
int buffer;
while (read (m_pTimeoutFDS[0], &buffer, sizeof(buffer)) > 0)
continue;
while (read (m_pTimeoutFDS[0], &buffer, sizeof(buffer)) > 0);
}
}