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

Unified Diff: src/ports/SkMutex_pthread.h

Issue 419113002: Fix thread unsafe mutex initialization. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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
Index: src/ports/SkMutex_pthread.h
diff --git a/src/ports/SkMutex_pthread.h b/src/ports/SkMutex_pthread.h
index f71016b31e88a28b3cc1932a2e4bf1d0f0c93abd..2227a528eb79fa823a1d1c1099b637313570d973 100644
--- a/src/ports/SkMutex_pthread.h
+++ b/src/ports/SkMutex_pthread.h
@@ -89,9 +89,6 @@ private:
#define SK_BASE_MUTEX_INIT { PTHREAD_MUTEX_INITIALIZER, SkDEBUGCODE(0) }
// Using POD-style initialization prevents the generation of a static initializer.
-#define SK_DECLARE_STATIC_MUTEX(name) static SkBaseMutex name = SK_BASE_MUTEX_INIT
-
-// Special case used when the static mutex must be available globally.
-#define SK_DECLARE_GLOBAL_MUTEX(name) SkBaseMutex name = SK_BASE_MUTEX_INIT
+#define SK_DECLARE_STATIC_MUTEX(name) static void SK_MACRO_APPEND_LINE(name)(); static SkBaseMutex name = SK_BASE_MUTEX_INIT
mtklein 2014/07/25 12:35:33 Add a comment about the function declaration here
bungeman-skia 2014/07/25 14:40:40 Hmmm... this one is actually safe (well, in practi
#endif

Powered by Google App Engine
This is Rietveld 408576698