Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Unified Diff: third_party/WebKit/Source/wtf/SpinLock.cpp

Issue 1461743002: Add noBarrierStore to WTF and use it for spinlocks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: oops Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/wtf/Atomics.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f958c0fbf956154d00feb0031532a73568fc3f29 100644
--- a/third_party/WebKit/Source/wtf/SpinLock.cpp
+++ b/third_party/WebKit/Source/wtf/SpinLock.cpp
@@ -62,13 +62,13 @@ void slowSpinLockLock(int volatile* lock)
for (int count = 0; count < kYieldProcessorTries; ++count) {
// Let the Processor know we're spinning.
YIELD_PROCESSOR;
- if (!*lock && LIKELY(!atomicTestAndSetToOne(lock)))
+ if (!noBarrierLoad(lock) && LIKELY(!atomicTestAndSetToOne(lock)))
return;
}
// Give the OS a chance to schedule something on this core.
YIELD_THREAD;
- } while (*lock);
+ } while (noBarrierLoad(lock));
} while (UNLIKELY(atomicTestAndSetToOne(lock)));
}
« no previous file with comments | « third_party/WebKit/Source/wtf/Atomics.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698