[TaskScheduler]: Spawn workers from GetWork().
In an effort to avoid creating threads from the main thread, this CL avoids the creation of a new idle thread after waking up the current idle thread from the main thread. This is done by moving a call to MaintainAtLeastOneIdleWorkerLockRequired() from WakeUpOneWorkerLockRequired() to GetWork(). Note that a call to MaintainAtLeastOneIdleWorkerLockRequired() is still done before waking up a worker in WakeUpOneWorkerLockRequired(), in case no idle thread was created yet. Bug: 847501 Change-Id: Ib3903c117a781a72f9d6a6aaeceee6554e5b9803 Reviewed-on: https://chromium-review.googlesource.com/c/1338382 Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org> Reviewed-by:Gabriel Charette <gab@chromium.org> Reviewed-by:
François Doray <fdoray@chromium.org> Cr-Commit-Position: refs/heads/master@{#609848}
Showing
Please register or sign in to comment