| Index: src/ports/SkMutex_pthread.h
|
| diff --git a/src/ports/SkMutex_pthread.h b/src/ports/SkMutex_pthread.h
|
| index 3bf3628588cd3b66b085325697fb98f61008ae2d..9aaa0612e76911f24a14f971e1b27fa787a019cd 100644
|
| --- a/src/ports/SkMutex_pthread.h
|
| +++ b/src/ports/SkMutex_pthread.h
|
| @@ -89,11 +89,13 @@ private:
|
| #define SK_BASE_MUTEX_INIT { PTHREAD_MUTEX_INITIALIZER, SkDEBUGCODE(0) }
|
|
|
| // Using POD-style initialization prevents the generation of a static initializer.
|
| +//
|
| // Without magic statics there are no thread safety guarantees on initialization
|
| -// of local statics (even POD).
|
| -// As a result, it is illegal to SK_DECLARE_STATIC_MUTEX in a function.
|
| -#define SK_DECLARE_STATIC_MUTEX(name) \
|
| - static inline void SK_MACRO_APPEND_LINE(name)(){} \
|
| - static SkBaseMutex name = SK_BASE_MUTEX_INIT
|
| +// of local statics (even POD). As a result, it is illegal to use
|
| +// SK_DECLARE_STATIC_MUTEX in a function.
|
| +//
|
| +// Because SkBaseMutex is not a primitive, a static SkBaseMutex cannot be
|
| +// initialized in a class with this macro.
|
| +#define SK_DECLARE_STATIC_MUTEX(name) namespace {} static SkBaseMutex name = SK_BASE_MUTEX_INIT
|
|
|
| #endif
|
|
|