Use SK_DECLARE_STATIC_MUTEX for global mutex.
authormtklein <mtklein@chromium.org>
Mon, 13 Jul 2015 13:15:36 +0000 (06:15 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 13 Jul 2015 13:15:36 +0000 (06:15 -0700)
This initializes the mutex at link time on non-Windows platforms,
rather than at pre-main-runtime like `static SkMutex gFoo;`

BUG=skia:

Review URL: https://codereview.chromium.org/1226403007

src/ports/SkFontHost_mac.cpp

index bfacb07..b55aa35 100755 (executable)
@@ -53,7 +53,7 @@
 #define USE_GLOBAL_MUTEX_FOR_CG_ACCESS
 
 #ifdef USE_GLOBAL_MUTEX_FOR_CG_ACCESS
-    static SkMutex gCGMutex;
+    SK_DECLARE_STATIC_MUTEX(gCGMutex);
     #define AUTO_CG_LOCK()  SkAutoMutexAcquire amc(gCGMutex)
 #else
     #define AUTO_CG_LOCK()