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

Unified Diff: src/ports/SkMutex_win.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_win.h
diff --git a/src/ports/SkMutex_win.h b/src/ports/SkMutex_win.h
index d84b0e42fd0da5fe0607544c6453001283d62a03..f98570ac7762a6f5380548675cb6a91817c11d7f 100644
--- a/src/ports/SkMutex_win.h
+++ b/src/ports/SkMutex_win.h
@@ -73,7 +73,7 @@ private:
class SkMutex : public SkBaseMutex { };
// Windows currently provides no documented means of POD initializing a CRITICAL_SECTION.
-#define SK_DECLARE_STATIC_MUTEX(name) static SkBaseMutex name
-#define SK_DECLARE_GLOBAL_MUTEX(name) SkBaseMutex name
+// As a result, it is illegal to SK_DECLARE_STATIC_MUTEX in a function.
+#define SK_DECLARE_STATIC_MUTEX(name) static void SK_MACRO_APPEND_LINE(name)(); static SkBaseMutex name
#endif

Powered by Google App Engine
This is Rietveld 408576698