| Index: third_party/WebKit/Source/wtf/SpinLock.cpp
|
| diff --git a/third_party/WebKit/Source/wtf/SpinLock.cpp b/third_party/WebKit/Source/wtf/SpinLock.cpp
|
| index 0b5586e66cb899ad71f3763bfe623f5754ab2112..8b9c3d12b3d9ea2d0c3413297fff901b6992e05e 100644
|
| --- a/third_party/WebKit/Source/wtf/SpinLock.cpp
|
| +++ b/third_party/WebKit/Source/wtf/SpinLock.cpp
|
| @@ -51,25 +51,24 @@
|
|
|
| namespace WTF {
|
|
|
| -void slowSpinLockLock(int volatile* lock)
|
| -{
|
| - // The value of kYieldProcessorTries is cargo culted from TCMalloc, Windows
|
| - // critical section defaults, and various other recommendations.
|
| - // TODO(jschuh): Further tuning may be warranted.
|
| - static const int kYieldProcessorTries = 1000;
|
| +void slowSpinLockLock(int volatile* lock) {
|
| + // The value of kYieldProcessorTries is cargo culted from TCMalloc, Windows
|
| + // critical section defaults, and various other recommendations.
|
| + // TODO(jschuh): Further tuning may be warranted.
|
| + static const int kYieldProcessorTries = 1000;
|
| + do {
|
| do {
|
| - do {
|
| - for (int count = 0; count < kYieldProcessorTries; ++count) {
|
| - // Let the Processor know we're spinning.
|
| - YIELD_PROCESSOR;
|
| - if (!*lock && LIKELY(!atomicTestAndSetToOne(lock)))
|
| - return;
|
| - }
|
| + for (int count = 0; count < kYieldProcessorTries; ++count) {
|
| + // Let the Processor know we're spinning.
|
| + YIELD_PROCESSOR;
|
| + if (!*lock && LIKELY(!atomicTestAndSetToOne(lock)))
|
| + return;
|
| + }
|
|
|
| - // Give the OS a chance to schedule something on this core.
|
| - YIELD_THREAD;
|
| - } while (*lock);
|
| - } while (UNLIKELY(atomicTestAndSetToOne(lock)));
|
| + // Give the OS a chance to schedule something on this core.
|
| + YIELD_THREAD;
|
| + } while (*lock);
|
| + } while (UNLIKELY(atomicTestAndSetToOne(lock)));
|
| }
|
|
|
| -} // namespace WTF
|
| +} // namespace WTF
|
|
|