Remove SkThread.h, include SkMutex.h or SkAtomics.h as appropriate.

SkThread.h doesn't do anything anymore execept include those two,
and thankfully, it doesn't seem to be mentioned outside Skia.

No public API changes.
TBR=reed@google.com

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/c50acf2321d7a934c80d754e9cbe936dfb8eb4cc

Review URL: https://codereview.chromium.org/1215393002
diff --git a/bench/MutexBench.cpp b/bench/MutexBench.cpp
index 7fd8fab..8d7eb98 100644
--- a/bench/MutexBench.cpp
+++ b/bench/MutexBench.cpp
@@ -5,7 +5,7 @@
  * found in the LICENSE file.
  */
 #include "Benchmark.h"
-#include "SkThread.h"
+#include "SkMutex.h"
 
 class MutexBench : public Benchmark {
 public:
diff --git a/bench/RefCntBench.cpp b/bench/RefCntBench.cpp
index 78b02ed..ee5d746 100644
--- a/bench/RefCntBench.cpp
+++ b/bench/RefCntBench.cpp
@@ -6,8 +6,8 @@
  */
 #include <memory>
 #include "Benchmark.h"
+#include "SkAtomics.h"
 #include "SkRefCnt.h"
-#include "SkThread.h"
 #include "SkWeakRefCnt.h"
 
 enum {
diff --git a/dm/DM.cpp b/dm/DM.cpp
index c3a4272..6b34641 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -18,6 +18,7 @@
 #include "SkForceLinking.h"
 #include "SkGraphics.h"
 #include "SkMD5.h"
+#include "SkMutex.h"
 #include "SkOSFile.h"
 #include "SkTHash.h"
 #include "SkTaskGroup.h"
diff --git a/dm/DMJsonWriter.cpp b/dm/DMJsonWriter.cpp
index 04ae2ce..5317567 100644
--- a/dm/DMJsonWriter.cpp
+++ b/dm/DMJsonWriter.cpp
@@ -11,10 +11,10 @@
 #include "SkCommonFlags.h"
 #include "SkData.h"
 #include "SkJSONCPP.h"
+#include "SkMutex.h"
 #include "SkOSFile.h"
 #include "SkStream.h"
 #include "SkTArray.h"
-#include "SkThread.h"
 
 namespace DM {
 
diff --git a/gyp/core.gypi b/gyp/core.gypi
index edc77e1..10149d8 100644
--- a/gyp/core.gypi
+++ b/gyp/core.gypi
@@ -323,7 +323,6 @@
         '<(skia_include_path)/core/SkTSearch.h',
         '<(skia_include_path)/core/SkTemplates.h',
         '<(skia_include_path)/core/SkTextBlob.h',
-        '<(skia_include_path)/core/SkThread.h',
         '<(skia_include_path)/core/SkTime.h',
         '<(skia_include_path)/core/SkTLazy.h',
         '<(skia_include_path)/core/SkTypeface.h',
diff --git a/include/core/SkThread.h b/include/core/SkThread.h
deleted file mode 100644
index 67e0b72..0000000
--- a/include/core/SkThread.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright 2006 The Android Open Source Project
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkThread_DEFINED
-#define SkThread_DEFINED
-
-// TODO: delete this file, or maybe move the definition of SkThread here.
-
-#include "SkAtomics.h"
-#include "SkMutex.h"
-
-#endif
diff --git a/include/core/SkWeakRefCnt.h b/include/core/SkWeakRefCnt.h
index 0798f4e..a550951 100644
--- a/include/core/SkWeakRefCnt.h
+++ b/include/core/SkWeakRefCnt.h
@@ -9,7 +9,7 @@
 #define SkWeakRefCnt_DEFINED
 
 #include "SkRefCnt.h"
-#include "SkThread.h"
+#include "SkAtomics.h"
 
 /** \class SkWeakRefCnt
 
diff --git a/include/ports/SkFontMgr_indirect.h b/include/ports/SkFontMgr_indirect.h
index 0977eea..96ba363 100644
--- a/include/ports/SkFontMgr_indirect.h
+++ b/include/ports/SkFontMgr_indirect.h
@@ -11,6 +11,7 @@
 #include "SkDataTable.h"
 #include "SkFontMgr.h"
 #include "SkFontStyle.h"
+#include "SkMutex.h"
 #include "SkRemotableFontMgr.h"
 #include "SkTArray.h"
 #include "SkTypeface.h"
diff --git a/src/core/SkAAClip.cpp b/src/core/SkAAClip.cpp
index 19e94c8..902b87a 100644
--- a/src/core/SkAAClip.cpp
+++ b/src/core/SkAAClip.cpp
@@ -7,11 +7,11 @@
  */
 
 #include "SkAAClip.h"
+#include "SkAtomics.h"
 #include "SkBlitter.h"
 #include "SkColorPriv.h"
 #include "SkPath.h"
 #include "SkScan.h"
-#include "SkThread.h"
 #include "SkUtils.h"
 
 class AutoAAClipValidate {
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index 8f79912..aa26bdc 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -7,6 +7,7 @@
  */
 
 
+#include "SkAtomics.h"
 #include "SkBitmap.h"
 #include "SkColorPriv.h"
 #include "SkDither.h"
@@ -14,14 +15,13 @@
 #include "SkImagePriv.h"
 #include "SkMallocPixelRef.h"
 #include "SkMask.h"
-#include "SkReadBuffer.h"
-#include "SkWriteBuffer.h"
+#include "SkPackBits.h"
 #include "SkPixelRef.h"
-#include "SkThread.h"
+#include "SkReadBuffer.h"
 #include "SkUnPreMultiply.h"
 #include "SkUtils.h"
 #include "SkValidationUtils.h"
-#include "SkPackBits.h"
+#include "SkWriteBuffer.h"
 #include <new>
 
 static bool reset_return_false(SkBitmap* bm) {
diff --git a/src/core/SkBitmapHeap.h b/src/core/SkBitmapHeap.h
index 07f629c..259d947 100644
--- a/src/core/SkBitmapHeap.h
+++ b/src/core/SkBitmapHeap.h
@@ -12,7 +12,7 @@
 #include "SkFlattenable.h"
 #include "SkRefCnt.h"
 #include "SkTDArray.h"
-#include "SkThread.h"
+#include "SkAtomics.h"
 
 /**
  * SkBitmapHeapEntry provides users of SkBitmapHeap (using internal storage) with a means to...
@@ -52,7 +52,7 @@
 
 class SkBitmapHeapReader : public SkRefCnt {
 public:
-    
+
 
     SkBitmapHeapReader() : INHERITED() {}
     virtual SkBitmap* getBitmap(int32_t slot) const = 0;
@@ -69,7 +69,7 @@
 public:
     class ExternalStorage : public SkRefCnt {
      public:
-        
+
 
         virtual bool insert(const SkBitmap& bitmap, int32_t slot) = 0;
 
diff --git a/src/core/SkCachedData.h b/src/core/SkCachedData.h
index 886ca3e..6493a75 100644
--- a/src/core/SkCachedData.h
+++ b/src/core/SkCachedData.h
@@ -8,7 +8,7 @@
 #ifndef SkCachedData_DEFINED
 #define SkCachedData_DEFINED
 
-#include "SkThread.h"
+#include "SkMutex.h"
 
 class SkDiscardableMemory;
 
@@ -78,7 +78,7 @@
 #else
     void validate() const {}
 #endif
-    
+
    /*
      *  Attaching a data to to a SkResourceCache (only one at a time) enables the data to be
      *  unlocked when the cache is the only owner, thus freeing it to be purged (assuming the
diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp
index e0c3db0..c4c68ce 100644
--- a/src/core/SkClipStack.cpp
+++ b/src/core/SkClipStack.cpp
@@ -5,11 +5,11 @@
  * found in the LICENSE file.
  */
 
+#include "SkAtomics.h"
 #include "SkCanvas.h"
 #include "SkClipStack.h"
 #include "SkPath.h"
 #include "SkPathOps.h"
-#include "SkThread.h"
 
 #include <new>
 
diff --git a/src/core/SkDeviceProfile.cpp b/src/core/SkDeviceProfile.cpp
index 8d60151..188e12b 100644
--- a/src/core/SkDeviceProfile.cpp
+++ b/src/core/SkDeviceProfile.cpp
@@ -7,7 +7,7 @@
 
 
 #include "SkDeviceProfile.h"
-#include "SkThread.h"
+#include "SkMutex.h"
 
 #define DEFAULT_GAMMAEXP        2.2f
 #define DEFAULT_CONTRASTSCALE   0.5f
diff --git a/src/core/SkDrawable.cpp b/src/core/SkDrawable.cpp
index 41547ee..5052270 100644
--- a/src/core/SkDrawable.cpp
+++ b/src/core/SkDrawable.cpp
@@ -5,9 +5,9 @@
  * found in the LICENSE file.
  */
 
+#include "SkAtomics.h"
 #include "SkCanvas.h"
 #include "SkDrawable.h"
-#include "SkThread.h"
 
 static int32_t next_generation_id() {
     static int32_t gCanvasDrawableGenerationID;
diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp
index ec34227..6ae17b1 100755
--- a/src/core/SkGlyphCache.cpp
+++ b/src/core/SkGlyphCache.cpp
@@ -9,10 +9,11 @@
 #include "SkGlyphCache_Globals.h"
 #include "SkGraphics.h"
 #include "SkLazyPtr.h"
+#include "SkMutex.h"
 #include "SkPaint.h"
 #include "SkPath.h"
-#include "SkTemplates.h"
 #include "SkTLS.h"
+#include "SkTemplates.h"
 #include "SkTypeface.h"
 
 //#define SPEW_PURGE_STATUS
@@ -417,8 +418,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////
 
-#include "SkThread.h"
-
 size_t SkGlyphCache_Globals::setCacheSizeLimit(size_t newLimit) {
     static const size_t minLimit = 256 * 1024;
     if (newLimit < minLimit) {
diff --git a/src/core/SkGlyphCache_Globals.h b/src/core/SkGlyphCache_Globals.h
index 4bd607c..e8f950f 100644
--- a/src/core/SkGlyphCache_Globals.h
+++ b/src/core/SkGlyphCache_Globals.h
@@ -9,6 +9,7 @@
 #define SkGlyphCache_Globals_DEFINED
 
 #include "SkGlyphCache.h"
+#include "SkMutex.h"
 #include "SkTLS.h"
 
 #ifndef SK_DEFAULT_FONT_CACHE_COUNT_LIMIT
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 7233ec6..394d8b2 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -13,12 +13,13 @@
 #include "SkDevice.h"
 #include "SkLazyPtr.h"
 #include "SkMatrixImageFilter.h"
+#include "SkMutex.h"
 #include "SkReadBuffer.h"
-#include "SkWriteBuffer.h"
 #include "SkRect.h"
 #include "SkTDynamicHash.h"
 #include "SkTInternalLList.h"
 #include "SkValidationUtils.h"
+#include "SkWriteBuffer.h"
 #if SK_SUPPORT_GPU
 #include "GrContext.h"
 #include "GrDrawContext.h"
@@ -28,9 +29,9 @@
 
 #ifdef SK_BUILD_FOR_IOS
   enum { kDefaultCacheSize = 2 * 1024 * 1024 };
-#else 
+#else
   enum { kDefaultCacheSize = 128 * 1024 * 1024 };
-#endif 
+#endif
 
 static int32_t next_image_filter_unique_id() {
     static int32_t gImageFilterUniqueID;
@@ -546,4 +547,4 @@
                                        SkBitmap* result, SkIPoint* offset) {
     return fDevice->filterImage(filter, src, ctx, result, offset);
 }
-    
+
diff --git a/src/core/SkMessageBus.h b/src/core/SkMessageBus.h
index b25ab80..6f032a1 100644
--- a/src/core/SkMessageBus.h
+++ b/src/core/SkMessageBus.h
@@ -9,9 +9,9 @@
 #define SkMessageBus_DEFINED
 
 #include "SkLazyPtr.h"
+#include "SkMutex.h"
 #include "SkTArray.h"
 #include "SkTDArray.h"
-#include "SkThread.h"
 #include "SkTypes.h"
 
 template <typename Message>
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index f40aeff..eae8ec7 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -17,6 +17,7 @@
 #include "SkImageFilter.h"
 #include "SkMaskFilter.h"
 #include "SkMaskGamma.h"
+#include "SkMutex.h"
 #include "SkReadBuffer.h"
 #include "SkWriteBuffer.h"
 #include "SkPaintDefaults.h"
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index daac077..9381f48 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -12,7 +12,6 @@
 #include "SkPathPriv.h"
 #include "SkPathRef.h"
 #include "SkRRect.h"
-#include "SkThread.h"
 
 ////////////////////////////////////////////////////////////////////////////
 
@@ -1881,7 +1880,7 @@
     }
 
     unsigned version = packed & 0xFF;
-    
+
     fConvexity = (packed >> kConvexity_SerializationShift) & 0xFF;
     fFillType = (packed >> kFillType_SerializationShift) & 0xFF;
     uint8_t dir = (packed >> kDirection_SerializationShift) & 0x3;
diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp
index 6e1f5c6..082435f 100644
--- a/src/core/SkPixelRef.cpp
+++ b/src/core/SkPixelRef.cpp
@@ -6,8 +6,8 @@
  */
 
 #include "SkBitmapCache.h"
+#include "SkMutex.h"
 #include "SkPixelRef.h"
-#include "SkThread.h"
 #include "SkTraceEvent.h"
 
 //#define SK_SUPPORT_LEGACY_UNBALANCED_PIXELREF_LOCKCOUNT
diff --git a/src/core/SkRegion.cpp b/src/core/SkRegion.cpp
index 24d7248..05ba4f4 100644
--- a/src/core/SkRegion.cpp
+++ b/src/core/SkRegion.cpp
@@ -7,9 +7,9 @@
  */
 
 
+#include "SkAtomics.h"
 #include "SkRegionPriv.h"
 #include "SkTemplates.h"
-#include "SkThread.h"
 #include "SkUtils.h"
 
 /* Region Layout
diff --git a/src/core/SkRegionPriv.h b/src/core/SkRegionPriv.h
index 00feede..9ddefc0 100644
--- a/src/core/SkRegionPriv.h
+++ b/src/core/SkRegionPriv.h
@@ -11,7 +11,7 @@
 #define SkRegionPriv_DEFINED
 
 #include "SkRegion.h"
-#include "SkThread.h"
+#include "SkAtomics.h"
 
 #define assert_sentinel(value, isSentinel) \
     SkASSERT(((value) == SkRegion::kRunTypeSentinel) == isSentinel)
diff --git a/src/core/SkResourceCache.cpp b/src/core/SkResourceCache.cpp
index f0fe721..6c76d35 100644
--- a/src/core/SkResourceCache.cpp
+++ b/src/core/SkResourceCache.cpp
@@ -8,6 +8,7 @@
 #include "SkChecksum.h"
 #include "SkMessageBus.h"
 #include "SkMipMap.h"
+#include "SkMutex.h"
 #include "SkPixelRef.h"
 #include "SkResourceCache.h"
 
@@ -74,7 +75,7 @@
 
 class SkOneShotDiscardablePixelRef : public SkPixelRef {
 public:
-    
+
     // Ownership of the discardablememory is transfered to the pixelref
     SkOneShotDiscardablePixelRef(const SkImageInfo&, SkDiscardableMemory*, size_t rowBytes);
     ~SkOneShotDiscardablePixelRef();
@@ -236,7 +237,7 @@
 
 void SkResourceCache::add(Rec* rec) {
     this->checkMessages();
-    
+
     SkASSERT(rec);
     // See if we already have this key (racy inserts, etc.)
     Rec* existing = fHash->find(rec->getKey());
@@ -244,7 +245,7 @@
         SkDELETE(rec);
         return;
     }
-    
+
     this->addToHead(rec);
     fHash->add(rec);
 
@@ -357,7 +358,7 @@
 
 SkCachedData* SkResourceCache::newCachedData(size_t bytes) {
     this->checkMessages();
-    
+
     if (fDiscardableFactory) {
         SkDiscardableMemory* dm = fDiscardableFactory(bytes);
         return dm ? SkNEW_ARGS(SkCachedData, (bytes, dm)) : NULL;
@@ -515,8 +516,6 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-#include "SkThread.h"
-
 SK_DECLARE_STATIC_MUTEX(gMutex);
 static SkResourceCache* gResourceCache = NULL;
 static void cleanup_gResourceCache() {
diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp
index 4ce42dd..b765aad 100644
--- a/src/core/SkScalerContext.cpp
+++ b/src/core/SkScalerContext.cpp
@@ -21,7 +21,6 @@
 #include "SkRasterizer.h"
 #include "SkRasterClip.h"
 #include "SkStroke.h"
-#include "SkThread.h"
 
 #define ComputeBWRowBytes(width)        (((unsigned)(width) + 7) >> 3)
 
diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp
index f146345..3298496 100644
--- a/src/core/SkShader.cpp
+++ b/src/core/SkShader.cpp
@@ -5,17 +5,17 @@
  * found in the LICENSE file.
  */
 
+#include "SkAtomics.h"
 #include "SkBitmapProcShader.h"
 #include "SkColorShader.h"
 #include "SkEmptyShader.h"
-#include "SkReadBuffer.h"
 #include "SkMallocPixelRef.h"
 #include "SkPaint.h"
 #include "SkPicture.h"
 #include "SkPictureShader.h"
+#include "SkReadBuffer.h"
 #include "SkScalar.h"
 #include "SkShader.h"
-#include "SkThread.h"
 #include "SkWriteBuffer.h"
 
 //#define SK_TRACK_SHADER_LIFETIME
diff --git a/src/core/SkString.cpp b/src/core/SkString.cpp
index c10347d..5c63a8b 100644
--- a/src/core/SkString.cpp
+++ b/src/core/SkString.cpp
@@ -7,9 +7,9 @@
  */
 
 
-#include "SkString.h"
+#include "SkAtomics.h"
 #include "SkFixed.h"
-#include "SkThread.h"
+#include "SkString.h"
 #include "SkUtils.h"
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/src/core/SkTLS.cpp b/src/core/SkTLS.cpp
index 3f78a24..346fed8 100755
--- a/src/core/SkTLS.cpp
+++ b/src/core/SkTLS.cpp
@@ -1,3 +1,10 @@
+/*
+ * Copyright 2012 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
 #include "SkTLS.h"
 
 // enable to help debug TLS storage
@@ -5,7 +12,7 @@
 
 
 #ifdef SK_TRACE_TLS_LIFETIME
-    #include "SkThread.h"
+    #include "SkAtomics.h"
     static int32_t gTLSRecCount;
 #endif
 
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
index 2c7db68..c94e22f 100644
--- a/src/core/SkTypeface.cpp
+++ b/src/core/SkTypeface.cpp
@@ -10,6 +10,7 @@
 #include "SkFontDescriptor.h"
 #include "SkFontMgr.h"
 #include "SkLazyPtr.h"
+#include "SkMutex.h"
 #include "SkOTTable_OS_2.h"
 #include "SkStream.h"
 #include "SkTypeface.h"
diff --git a/src/core/SkTypefaceCache.cpp b/src/core/SkTypefaceCache.cpp
index f253b60..49779fc 100644
--- a/src/core/SkTypefaceCache.cpp
+++ b/src/core/SkTypefaceCache.cpp
@@ -9,7 +9,8 @@
 
 
 #include "SkTypefaceCache.h"
-#include "SkThread.h"
+#include "SkAtomics.h"
+#include "SkMutex.h"
 
 #define TYPEFACE_CACHE_LIMIT    1024
 
diff --git a/src/fonts/SkFontMgr_fontconfig.cpp b/src/fonts/SkFontMgr_fontconfig.cpp
index 9294990..0873aa1 100644
--- a/src/fonts/SkFontMgr_fontconfig.cpp
+++ b/src/fonts/SkFontMgr_fontconfig.cpp
@@ -5,14 +5,14 @@
  * found in the LICENSE file.
  */
 
-#include "SkFontMgr.h"
-#include "SkFontStyle.h"
 #include "SkFontConfigInterface.h"
 #include "SkFontConfigTypeface.h"
+#include "SkFontMgr.h"
+#include "SkFontStyle.h"
 #include "SkMath.h"
+#include "SkMutex.h"
 #include "SkString.h"
 #include "SkTDArray.h"
-#include "SkThread.h"
 
 // for now we pull these in directly. eventually we will solely rely on the
 // SkFontConfigInterface instance.
diff --git a/src/fonts/SkTestScalerContext.cpp b/src/fonts/SkTestScalerContext.cpp
index 28b53b3..50706f6 100644
--- a/src/fonts/SkTestScalerContext.cpp
+++ b/src/fonts/SkTestScalerContext.cpp
@@ -42,7 +42,7 @@
 
 #ifdef SK_DEBUG
 
-#include "SkThread.h"
+#include "SkMutex.h"
 SK_DECLARE_STATIC_MUTEX(gUsedCharsMutex);
 
 #endif
diff --git a/src/gpu/GrBatch.h b/src/gpu/GrBatch.h
index eb38563..21dc3d2 100644
--- a/src/gpu/GrBatch.h
+++ b/src/gpu/GrBatch.h
@@ -12,8 +12,8 @@
 #include "GrBatchTarget.h"
 #include "GrGeometryProcessor.h"
 #include "GrVertices.h"
+#include "SkAtomics.h"
 #include "SkRefCnt.h"
-#include "SkThread.h"
 #include "SkTypes.h"
 
 class GrGpu;
@@ -39,7 +39,7 @@
 
 class GrBatch : public SkRefCnt {
 public:
-    
+
     GrBatch() : fClassID(kIllegalBatchClassID), fNumberOfDraws(0) { SkDEBUGCODE(fUsed = false;) }
     virtual ~GrBatch() {}
 
diff --git a/src/gpu/gl/GrGLNoOpInterface.cpp b/src/gpu/gl/GrGLNoOpInterface.cpp
index 396eaa4..f47f254 100644
--- a/src/gpu/gl/GrGLNoOpInterface.cpp
+++ b/src/gpu/gl/GrGLNoOpInterface.cpp
@@ -6,8 +6,8 @@
  */
 
 #include "GrGLNoOpInterface.h"
+#include "SkMutex.h"
 #include "SkString.h"
-#include "SkThread.h"
 
 // the OpenGLES 2.0 spec says this must be >= 128
 static const GrGLint kDefaultMaxVertexUniformVectors = 128;
diff --git a/src/lazy/SkDiscardableMemoryPool.cpp b/src/lazy/SkDiscardableMemoryPool.cpp
index 5b9d87f..70072c6 100644
--- a/src/lazy/SkDiscardableMemoryPool.cpp
+++ b/src/lazy/SkDiscardableMemoryPool.cpp
@@ -9,8 +9,8 @@
 #include "SkDiscardableMemoryPool.h"
 #include "SkImageGenerator.h"
 #include "SkLazyPtr.h"
+#include "SkMutex.h"
 #include "SkTInternalLList.h"
-#include "SkThread.h"
 
 // Note:
 // A PoolDiscardableMemory is memory that is counted in a pool.
diff --git a/src/pathops/SkPathOpsDebug.cpp b/src/pathops/SkPathOpsDebug.cpp
index 4942230..61f5096 100644
--- a/src/pathops/SkPathOpsDebug.cpp
+++ b/src/pathops/SkPathOpsDebug.cpp
@@ -5,10 +5,10 @@
  * found in the LICENSE file.
  */
 
-#include "SkPathOpsDebug.h"
+#include "SkMutex.h"
 #include "SkPath.h"
+#include "SkPathOpsDebug.h"
 #include "SkString.h"
-#include "SkThread.h"
 
 #if DEBUG_VALIDATE
 extern bool FLAGS_runFail;
@@ -316,7 +316,7 @@
             break;
         default:
             SkASSERT(0);
-    } 
+    }
     return result;
 }
 #endif
diff --git a/src/ports/SkFontConfigInterface_direct.cpp b/src/ports/SkFontConfigInterface_direct.cpp
index 239a790..8589cc2 100644
--- a/src/ports/SkFontConfigInterface_direct.cpp
+++ b/src/ports/SkFontConfigInterface_direct.cpp
@@ -15,6 +15,7 @@
 #include "SkBuffer.h"
 #include "SkFontConfigInterface.h"
 #include "SkLazyPtr.h"
+#include "SkMutex.h"
 #include "SkStream.h"
 #include "SkString.h"
 
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp
index c027831..6f235ed 100644
--- a/src/ports/SkFontHost_FreeType.cpp
+++ b/src/ports/SkFontHost_FreeType.cpp
@@ -17,12 +17,12 @@
 #include "SkMask.h"
 #include "SkMaskGamma.h"
 #include "SkMatrix22.h"
+#include "SkMutex.h"
 #include "SkOTUtils.h"
 #include "SkScalerContext.h"
 #include "SkStream.h"
 #include "SkString.h"
 #include "SkTemplates.h"
-#include "SkThread.h"
 #include "SkTypes.h"
 
 #if defined(SK_CAN_USE_DLOPEN)
diff --git a/src/ports/SkFontHost_FreeType_common.h b/src/ports/SkFontHost_FreeType_common.h
index 8ae872c..a9ca42b 100644
--- a/src/ports/SkFontHost_FreeType_common.h
+++ b/src/ports/SkFontHost_FreeType_common.h
@@ -10,6 +10,7 @@
 #define SKFONTHOST_FREETYPE_COMMON_H_
 
 #include "SkGlyph.h"
+#include "SkMutex.h"
 #include "SkScalerContext.h"
 #include "SkTypeface.h"
 #include "SkTypes.h"
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index 22e2954..5ad1c2f 100755
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -24,12 +24,13 @@
 #include "SkColorPriv.h"
 #include "SkDescriptor.h"
 #include "SkEndian.h"
-#include "SkFontDescriptor.h"
 #include "SkFloatingPoint.h"
+#include "SkFontDescriptor.h"
+#include "SkFontMgr.h"
 #include "SkGlyph.h"
 #include "SkLazyFnPtr.h"
 #include "SkMaskGamma.h"
-#include "SkSFNTHeader.h"
+#include "SkMutex.h"
 #include "SkOTTable_glyf.h"
 #include "SkOTTable_head.h"
 #include "SkOTTable_hhea.h"
@@ -37,13 +38,12 @@
 #include "SkOTUtils.h"
 #include "SkPaint.h"
 #include "SkPath.h"
-#include "SkString.h"
+#include "SkSFNTHeader.h"
 #include "SkStream.h"
-#include "SkThread.h"
+#include "SkString.h"
+#include "SkTypefaceCache.h"
 #include "SkTypeface_mac.h"
 #include "SkUtils.h"
-#include "SkTypefaceCache.h"
-#include "SkFontMgr.h"
 #include "SkUtils.h"
 
 #include <dlfcn.h>
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index bcbbe11..7463dab 100755
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -23,7 +23,6 @@
 #include "SkStream.h"
 #include "SkString.h"
 #include "SkTemplates.h"
-#include "SkThread.h"
 #include "SkTypeface_win.h"
 #include "SkTypefaceCache.h"
 #include "SkUtils.h"
diff --git a/src/ports/SkFontMgr_custom.cpp b/src/ports/SkFontMgr_custom.cpp
index 49744a1..cea0b48 100644
--- a/src/ports/SkFontMgr_custom.cpp
+++ b/src/ports/SkFontMgr_custom.cpp
@@ -15,7 +15,6 @@
 #include "SkRTConf.h"
 #include "SkString.h"
 #include "SkStream.h"
-#include "SkThread.h"
 #include "SkTSearch.h"
 #include "SkTypefaceCache.h"
 #include "SkTArray.h"
diff --git a/src/ports/SkFontMgr_fontconfig.cpp b/src/ports/SkFontMgr_fontconfig.cpp
index c3cb267..7000e31 100644
--- a/src/ports/SkFontMgr_fontconfig.cpp
+++ b/src/ports/SkFontMgr_fontconfig.cpp
@@ -11,10 +11,10 @@
 #include "SkFontMgr.h"
 #include "SkFontStyle.h"
 #include "SkMath.h"
+#include "SkMutex.h"
 #include "SkString.h"
 #include "SkStream.h"
 #include "SkTDArray.h"
-#include "SkThread.h"
 #include "SkTypefaceCache.h"
 #include "SkOSFile.h"
 
diff --git a/src/ports/SkFontMgr_win_dw.cpp b/src/ports/SkFontMgr_win_dw.cpp
index b0cdf3c..ca8b260 100644
--- a/src/ports/SkFontMgr_win_dw.cpp
+++ b/src/ports/SkFontMgr_win_dw.cpp
@@ -9,9 +9,9 @@
 #include "SkDWriteFontFileStream.h"
 #include "SkFontMgr.h"
 #include "SkHRESULT.h"
+#include "SkMutex.h"
 #include "SkStream.h"
 #include "SkTScopedComPtr.h"
-#include "SkThread.h"
 #include "SkTypeface.h"
 #include "SkTypefaceCache.h"
 #include "SkTypeface_win_dw.h"
diff --git a/src/ports/SkRemotableFontMgr_win_dw.cpp b/src/ports/SkRemotableFontMgr_win_dw.cpp
index d787a95..006346a 100644
--- a/src/ports/SkRemotableFontMgr_win_dw.cpp
+++ b/src/ports/SkRemotableFontMgr_win_dw.cpp
@@ -5,15 +5,15 @@
  * found in the LICENSE file.
  */
 
-#include "SkDataTable.h"
 #include "SkDWrite.h"
 #include "SkDWriteFontFileStream.h"
+#include "SkDataTable.h"
 #include "SkHRESULT.h"
+#include "SkMutex.h"
 #include "SkRemotableFontMgr.h"
 #include "SkStream.h"
 #include "SkString.h"
 #include "SkTArray.h"
-#include "SkThread.h"
 #include "SkTScopedComPtr.h"
 #include "SkTypeface_win.h"
 #include "SkTypes.h"
@@ -80,7 +80,7 @@
     }
 
 public:
-    
+
 
     /** localeNameLength must include the null terminator. */
     SkRemotableFontMgr_DirectWrite(IDWriteFontCollection* fontCollection,
diff --git a/src/ports/SkTLS_win.cpp b/src/ports/SkTLS_win.cpp
index dea8cd4..c6f3dfc 100644
--- a/src/ports/SkTLS_win.cpp
+++ b/src/ports/SkTLS_win.cpp
@@ -6,7 +6,7 @@
  */
 
 #include "SkTLS.h"
-#include "SkThread.h"
+#include "SkMutex.h"
 
 static bool gOnce = false;
 static DWORD gTlsIndex;
diff --git a/src/views/SkEvent.cpp b/src/views/SkEvent.cpp
index 52a0c4d..5f204c0 100644
--- a/src/views/SkEvent.cpp
+++ b/src/views/SkEvent.cpp
@@ -265,7 +265,7 @@
     #define EVENT_LOGN(s, n)
 #endif
 
-#include "SkThread.h"
+#include "SkMutex.h"
 #include "SkTime.h"
 
 class SkEvent_Globals {
diff --git a/src/views/SkEventSink.cpp b/src/views/SkEventSink.cpp
index 7763ade..42c1ceb 100644
--- a/src/views/SkEventSink.cpp
+++ b/src/views/SkEventSink.cpp
@@ -8,10 +8,8 @@
 
 
 #include "SkEventSink.h"
+#include "SkMutex.h"
 #include "SkTagList.h"
-#include "SkThread.h"
-
-#include "SkThread.h"
 #include "SkTime.h"
 
 class SkEventSink_Globals {
@@ -256,7 +254,7 @@
 
 #if 0   // experimental, not tested
 
-#include "SkThread.h"
+#include "SkMutex.h"
 #include "SkTDict.h"
 
 #define kMinStringBufferSize    128
diff --git a/src/views/SkOSMenu.cpp b/src/views/SkOSMenu.cpp
index ad0c73f..8c2e476 100644
--- a/src/views/SkOSMenu.cpp
+++ b/src/views/SkOSMenu.cpp
@@ -4,9 +4,9 @@
  * Use of this source code is governed by a BSD-style license that can be
  * found in the LICENSE file.
  */
-#include <stdarg.h>
+#include "SkAtomics.h"
 #include "SkOSMenu.h"
-#include "SkThread.h"
+#include <stdarg.h>
 
 static int gOSMenuCmd = 7000;
 
diff --git a/tests/AtomicTest.cpp b/tests/AtomicTest.cpp
index 8b5ac9b..7eb7a71 100644
--- a/tests/AtomicTest.cpp
+++ b/tests/AtomicTest.cpp
@@ -5,7 +5,7 @@
  * found in the LICENSE file.
  */
 
-#include "SkThread.h"
+#include "SkAtomics.h"
 #include "SkThreadUtils.h"
 #include "SkTypes.h"
 #include "Test.h"
diff --git a/tests/PathOpsExtendedTest.cpp b/tests/PathOpsExtendedTest.cpp
index df80f46..69a2d61 100644
--- a/tests/PathOpsExtendedTest.cpp
+++ b/tests/PathOpsExtendedTest.cpp
@@ -11,10 +11,10 @@
 #include "SkCanvas.h"
 #include "SkForceLinking.h"
 #include "SkMatrix.h"
+#include "SkMutex.h"
 #include "SkPaint.h"
 #include "SkRTConf.h"
 #include "SkStream.h"
-#include "SkThread.h"
 
 #ifdef SK_BUILD_FOR_MAC
 #include <sys/sysctl.h>
diff --git a/tests/PathOpsExtendedTest.h b/tests/PathOpsExtendedTest.h
index c4baa63..f8d7409 100644
--- a/tests/PathOpsExtendedTest.h
+++ b/tests/PathOpsExtendedTest.h
@@ -12,8 +12,6 @@
 #include "SkPath.h"
 #include "SkPathOpsTypes.h"
 #include "SkStream.h"
-#include "SkThread.h"
-#include "SkThreadUtils.h"
 #include "Test.h"
 
 DECLARE_bool(runFail);
diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp
index 2c1822d..00043c1 100644
--- a/tests/skia_test.cpp
+++ b/tests/skia_test.cpp
@@ -8,6 +8,7 @@
 #include "CrashHandler.h"
 #include "OverwriteLine.h"
 #include "Resources.h"
+#include "SkAtomics.h"
 #include "SkCommonFlags.h"
 #include "SkGraphics.h"
 #include "SkOSFile.h"
@@ -15,7 +16,6 @@
 #include "SkTArray.h"
 #include "SkTaskGroup.h"
 #include "SkTemplates.h"
-#include "SkThread.h"
 #include "SkTime.h"
 #include "Test.h"
 
diff --git a/tools/sk_tool_utils_font.cpp b/tools/sk_tool_utils_font.cpp
index 925bd7d..7b95fb0 100644
--- a/tools/sk_tool_utils_font.cpp
+++ b/tools/sk_tool_utils_font.cpp
@@ -7,9 +7,9 @@
 
 #include "Resources.h"
 #include "SkFontMgr.h"
+#include "SkMutex.h"
 #include "SkOSFile.h"
 #include "SkTestScalerContext.h"
-#include "SkThread.h"
 #include "SkUtils.h"
 #include "sk_tool_utils.h"
 
diff --git a/tools/skpdiff/SkDiffContext.h b/tools/skpdiff/SkDiffContext.h
index 8f4789f..9347d26 100644
--- a/tools/skpdiff/SkDiffContext.h
+++ b/tools/skpdiff/SkDiffContext.h
@@ -9,11 +9,11 @@
 #define SkDiffContext_DEFINED
 
 #include "SkImageDiffer.h"
+#include "SkMutex.h"
 #include "SkString.h"
 #include "SkTArray.h"
 #include "SkTDArray.h"
 #include "SkTLList.h"
-#include "SkThread.h"
 
 class SkWStream;
 
@@ -52,7 +52,7 @@
     void setWhiteDiffDir(const SkString& directory);
 
     /**
-     * Modify the pattern used to generate commonName (= the 
+     * Modify the pattern used to generate commonName (= the
      * basename of rgb/white diff files).
      *
      * - true: basename is a combination of the input file names.
@@ -61,10 +61,10 @@
      * For example, for:
      *   baselinePath=/tmp/dir/image-before.png
      *   testPath=/tmp/dir/image-after.png
-     * 
+     *
      * If setLongNames(true), commonName would be:
      *    image-before-png-vs-image-after-png.png
-     * 
+     *
      * If setLongNames(false), commonName would be:
      *   image-.png
      */
@@ -104,8 +104,8 @@
      *
      * The format of the JSON document is one top level array named "records".
      * Each record in the array is an object with the following values:
-     *    "commonName"     : string containing the output filename (basename) 
-     *                       depending on the value of 'longNames'. 
+     *    "commonName"     : string containing the output filename (basename)
+     *                       depending on the value of 'longNames'.
      *                       (see 'setLongNames' for an explanation and example).
      *    "baselinePath"   : string containing the path to the baseline image
      *    "testPath"       : string containing the path to the test image