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

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

Issue 1436153002: Apply clang-format with Chromium-style without column limit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/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 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
« 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