Kaydet (Commit) cb8bfa9a authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

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
üst e485703d
...@@ -370,6 +370,12 @@ bool SvpSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong ...@@ -370,6 +370,12 @@ bool SvpSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong
DoReleaseYield(nTimeoutMS); DoReleaseYield(nTimeoutMS);
} }
else if ( bEvent )
{
// Drain the wakeup pipe
int buffer;
while (read (m_pTimeoutFDS[0], &buffer, sizeof(buffer)) > 0);
}
return bEvent; return bEvent;
} }
...@@ -394,8 +400,7 @@ void SvpSalInstance::DoReleaseYield( int nTimeoutMS ) ...@@ -394,8 +400,7 @@ void SvpSalInstance::DoReleaseYield( int nTimeoutMS )
if( (aPoll.revents & POLLIN) != 0 ) if( (aPoll.revents & POLLIN) != 0 )
{ {
int buffer; int buffer;
while (read (m_pTimeoutFDS[0], &buffer, sizeof(buffer)) > 0) while (read (m_pTimeoutFDS[0], &buffer, sizeof(buffer)) > 0);
continue;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment