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

Unified Diff: third_party/WebKit/Source/wtf/Threading.h

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
Index: third_party/WebKit/Source/wtf/Threading.h
diff --git a/third_party/WebKit/Source/wtf/Threading.h b/third_party/WebKit/Source/wtf/Threading.h
index 184aafb430ba47562ae5cb13eac7cb2145a8626c..13d89326d1f50528909d5299edf3c85f5c3a911c 100644
--- a/third_party/WebKit/Source/wtf/Threading.h
+++ b/third_party/WebKit/Source/wtf/Threading.h
@@ -38,30 +38,30 @@
// For portability, we do not make use of C++11 thread-safe statics, as supported
// by some toolchains. Make use of double-checked locking to reduce overhead.
#define AtomicallyInitializedStaticReferenceInternal(T, name, initializer, LOCK, UNLOCK) \
- /* Init to nullptr is thread-safe on all implementations. */ \
- static void* name##Pointer = nullptr; \
- if (!WTF::acquireLoad(&name##Pointer)) { \
- LOCK; \
- if (!WTF::acquireLoad(&name##Pointer)) { \
- WTF::RemoveConst<T>::Type* initializerResult = initializer; \
- WTF::releaseStore(&name##Pointer, initializerResult); \
- } \
- UNLOCK; \
- } \
- T& name = *static_cast<T*>(name##Pointer)
+ /* Init to nullptr is thread-safe on all implementations. */ \
+ static void* name##Pointer = nullptr; \
+ if (!WTF::acquireLoad(&name##Pointer)) { \
+ LOCK; \
+ if (!WTF::acquireLoad(&name##Pointer)) { \
+ WTF::RemoveConst<T>::Type* initializerResult = initializer; \
+ WTF::releaseStore(&name##Pointer, initializerResult); \
+ } \
+ UNLOCK; \
+ } \
+ T& name = *static_cast<T*>(name##Pointer)
// Uses system-wide default lock. This version cannot be used before
// WTF::initializeThreading() is called.
-#define AtomicallyInitializedStaticReference(T, name, initializer) \
- AtomicallyInitializedStaticReferenceInternal( \
- T, name, initializer, \
- WTF::lockAtomicallyInitializedStaticMutex(), \
- WTF::unlockAtomicallyInitializedStaticMutex())
+#define AtomicallyInitializedStaticReference(T, name, initializer) \
+ AtomicallyInitializedStaticReferenceInternal( \
+ T, name, initializer, \
+ WTF::lockAtomicallyInitializedStaticMutex(), \
+ WTF::unlockAtomicallyInitializedStaticMutex())
// Same as above but uses a given lock.
-#define AtomicallyInitializedStaticReferenceWithLock(T, name, initializer, lockable) \
- AtomicallyInitializedStaticReferenceInternal( \
- T, name, initializer, lockable.lock(), lockable.unlock());
+#define AtomicallyInitializedStaticReferenceWithLock(T, name, initializer, lockable) \
+ AtomicallyInitializedStaticReferenceInternal( \
+ T, name, initializer, lockable.lock(), lockable.unlock());
namespace WTF {
@@ -82,9 +82,9 @@ WTF_EXPORT bool isBeforeThreadCreated();
WTF_EXPORT void willCreateThread();
#endif
-} // namespace WTF
+} // namespace WTF
using WTF::ThreadIdentifier;
using WTF::currentThread;
-#endif // Threading_h
+#endif // Threading_h
« no previous file with comments | « third_party/WebKit/Source/wtf/ThreadSpecificWin.cpp ('k') | third_party/WebKit/Source/wtf/ThreadingPrimitives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698