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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user