Fall back to a non-busy wait in NeedsLazyInstance
In some cases (servers SKUs of Windows when we get unlucky with the
timing?) we can end up with eight Chrome worker threads all spinning
madly in NeedsLazyInstance, waiting for another thread to finish
initializing the object. If the other thread is running at lower
priority then this busy waiting ensures that it never gets a chance to
run. Falling back to sleeping for 1 ms at a time will avoid this CPU
starvation.
Bug: 797129
Change-Id: I0e0541c9b84f6b808f11669d83ce6b19b41bb249
Reviewed-on: https://chromium-review.googlesource.com/852441
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527445}
CrOS-Libchrome-Original-Commit: cdf5faebbb47d9041b74288f8206cfeb84333a27
1 file changed