Index: include/utils/SkThreadPool.h |
diff --git a/include/utils/SkThreadPool.h b/include/utils/SkThreadPool.h |
index 6cb8b528d316624bb388b22b09eea132178fc251..0aa7c08ad53b6e48d8f82ce61b95dca36fdc679e 100644 |
--- a/include/utils/SkThreadPool.h |
+++ b/include/utils/SkThreadPool.h |
@@ -45,10 +45,17 @@ public: |
SK_DECLARE_INTERNAL_LLIST_INTERFACE(LinkedRunnable); |
}; |
- SkTInternalLList<LinkedRunnable> fQueue; |
- SkCondVar fReady; |
- SkTDArray<SkThread*> fThreads; |
- bool fDone; |
+ enum State { |
+ kRunning_State, // Normal case. We've been constructed and no one has called wait(). |
+ kWaiting_State, // wait has been called, but there still might be work to do or being done. |
+ kHalting_State, // There's no work to do and no thread is busy. All threads can shut down. |
+ }; |
+ |
+ SkTInternalLList<LinkedRunnable> fQueue; |
+ SkCondVar fReady; |
+ SkTDArray<SkThread*> fThreads; |
+ State fState; |
+ int fBusyThreads; |
static void Loop(void*); // Static because we pass in this. |
}; |