Index: include/private/SkMutex.h |
diff --git a/include/private/SkMutex.h b/include/private/SkMutex.h |
index 77a00f02354074ab6b6635ffaba4d3b48746401d..fce2932a74cad98ad4afa3ae15197d0de716b2d6 100644 |
--- a/include/private/SkMutex.h |
+++ b/include/private/SkMutex.h |
@@ -30,25 +30,15 @@ |
// initialized in a class with this macro. |
#define SK_DECLARE_STATIC_MUTEX(name) namespace {} static SkBaseMutex name = SK_BASE_MUTEX_INIT; |
-// TODO(herb): unify this with the ThreadID in SkSharedMutex.cpp. |
#ifdef SK_DEBUG |
- #ifdef SK_BUILD_FOR_WIN |
- #include <windows.h> |
- inline int64_t sk_get_thread_id() { return GetCurrentThreadId(); } |
- #else |
- #include <pthread.h> |
- inline int64_t sk_get_thread_id() { return (int64_t)pthread_self(); } |
- #endif |
+ #include "../private/SkThreadID.h" |
+ static const SkThreadID kNoOwner = 0; |
mtklein
2015/09/29 19:52:40
Think it makes sense to move this knowledge into S
herb_g
2015/09/29 20:25:02
Done.
|
#endif |
-typedef int64_t SkThreadID; |
- |
-SkDEBUGCODE(static const SkThreadID kNoOwner = 0;) |
- |
struct SkBaseMutex { |
void acquire() { |
fSemaphore.wait(); |
- SkDEBUGCODE(fOwner = sk_get_thread_id();) |
+ SkDEBUGCODE(fOwner = SkGetThreadID();) |
} |
void release() { |
@@ -58,7 +48,7 @@ struct SkBaseMutex { |
} |
void assertHeld() { |
- SkASSERT(fOwner == sk_get_thread_id()); |
+ SkASSERT(fOwner == SkGetThreadID()); |
} |
SkBaseSemaphore fSemaphore; |