Use SK_DECLARE_STATIC_MUTEX for global mutex.

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
This commit is contained in:
mtklein 2015-07-13 06:15:36 -07:00 committed by Commit bot
parent bd3e8cb42c
commit 4598fc3c12

View File

@ -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()