Avoid repetitive calling event processing while in park mode. (#3544)

This commit is contained in:
Nikolay Igotti
2019-11-05 18:45:05 +03:00
committed by GitHub
parent e8ad4712d3
commit 5fe93fb032
+2 -6
View File
@@ -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) {