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

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

Issue 1611343002: wtf reformat test Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pydent Created 4 years, 11 months 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/SpinLock.h ('k') | third_party/WebKit/Source/wtf/StaticConstructors.h » ('j') | 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 05f2174cf18adb8fe01c4a8060859e330f852402..e91bf19fbeb585face8cdccced375fd63842ceac 100644
--- a/third_party/WebKit/Source/wtf/SpinLock.cpp
+++ b/third_party/WebKit/Source/wtf/SpinLock.cpp
@@ -59,25 +59,25 @@
namespace WTF {
-void SpinLock::lockSlow()
-{
- // 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 SpinLock::lockSlow() {
+ // 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 (!m_lock.load(std::memory_order_relaxed) && LIKELY(!m_lock.exchange(true, std::memory_order_acq_rel)))
- return;
- }
+ for (int count = 0; count < kYieldProcessorTries; ++count) {
+ // Let the Processor know we're spinning.
+ YIELD_PROCESSOR;
+ if (!m_lock.load(std::memory_order_relaxed) &&
+ LIKELY(!m_lock.exchange(true, std::memory_order_acq_rel)))
+ return;
+ }
- // Give the OS a chance to schedule something on this core.
- YIELD_THREAD;
- } while (m_lock.load(std::memory_order_relaxed));
- } while (UNLIKELY(m_lock.exchange(true, std::memory_order_acq_rel)));
+ // Give the OS a chance to schedule something on this core.
+ YIELD_THREAD;
+ } while (m_lock.load(std::memory_order_relaxed));
+ } while (UNLIKELY(m_lock.exchange(true, std::memory_order_acq_rel)));
}
-} // namespace WTF
+} // namespace WTF
« no previous file with comments | « third_party/WebKit/Source/wtf/SpinLock.h ('k') | third_party/WebKit/Source/wtf/StaticConstructors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698