Avoid repetitive calling event processing while in park mode. (#3544)
This commit is contained in:
@@ -770,7 +770,7 @@ bool Worker::waitForQueueLocked(KLong timeoutMicroseconds, KLong* remaining) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (timeoutMicroseconds >= 0) {
|
if (timeoutMicroseconds >= 0) {
|
||||||
closestToRun = timeoutMicroseconds < closestToRun || closestToRun < 0 ? timeoutMicroseconds : closestToRun;
|
closestToRun = (timeoutMicroseconds < closestToRun || closestToRun < 0) ? timeoutMicroseconds : closestToRun;
|
||||||
}
|
}
|
||||||
if (closestToRun == 0) {
|
if (closestToRun == 0) {
|
||||||
// Just no wait at all here.
|
// Just no wait at all here.
|
||||||
@@ -819,11 +819,7 @@ bool Worker::park(KLong timeoutMicroseconds, bool process) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int processed = 0;
|
return processQueueElement(false) >= JOB_REGULAR;
|
||||||
while (processQueueElement(false) >= JOB_REGULAR) {
|
|
||||||
processed++;
|
|
||||||
}
|
|
||||||
return processed > 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JobKind Worker::processQueueElement(bool blocking) {
|
JobKind Worker::processQueueElement(bool blocking) {
|
||||||
|
|||||||
Reference in New Issue
Block a user