Remove all global mutexes

Remove the SkBaseMutex (and SkBaseSemaphore). This allows all the thread
annotation machinery to work.

Change-Id: I2da420ec3165ccbcd90c474c0b62bfef42df2a53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221340
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
diff --git a/src/pathops/SkPathOpsDebug.cpp b/src/pathops/SkPathOpsDebug.cpp
index 9d497c9..7ee44de 100644
--- a/src/pathops/SkPathOpsDebug.cpp
+++ b/src/pathops/SkPathOpsDebug.cpp
@@ -557,11 +557,11 @@
     SkDebugf("}\n");
 }
 
-SK_DECLARE_STATIC_MUTEX(gTestMutex);
-
 void SkPathOpsDebug::ShowPath(const SkPath& a, const SkPath& b, SkPathOp shapeOp,
         const char* testName) {
-    SkAutoMutexAcquire ac(gTestMutex);
+    static SkMutex& mutex = *(new SkMutex);
+
+    SkAutoMutexExclusive ac(mutex);
     show_function_header(testName);
     ShowOnePath(a, "path", true);
     ShowOnePath(b, "pathB", true);
@@ -574,10 +574,9 @@
 
 #if DEBUG_COIN
 
-SK_DECLARE_STATIC_MUTEX(gCoinDictMutex);
-
 void SkOpGlobalState::debugAddToGlobalCoinDicts() {
-    SkAutoMutexAcquire ac(&gCoinDictMutex);
+    static SkMutex& mutex = *(new SkMutex);
+    SkAutoMutexExclusive ac(mutex);
     SkPathOpsDebug::gCoinSumChangedDict.add(fCoinChangedDict);
     SkPathOpsDebug::gCoinSumVisitedDict.add(fCoinVisitedDict);
 }