Add SkThreadPool for managing threads.
Skia-ized from https://codereview.appspot.com/6755043/
TODO: Use SkThread and platform independent features.
Review URL: https://codereview.appspot.com/6777064
git-svn-id: http://skia.googlecode.com/svn/trunk@6217 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/utils/SkCountdown.h b/include/utils/SkCountdown.h
new file mode 100644
index 0000000..6bcec7d
--- /dev/null
+++ b/include/utils/SkCountdown.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2012 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkCountdown_DEFINED
+#define SkCountdown_DEFINED
+
+#include "SkCondVar.h"
+#include "SkRunnable.h"
+#include "SkTypes.h"
+
+class SkCountdown : public SkRunnable {
+public:
+ explicit SkCountdown(int32_t count);
+
+ /**
+ * Resets the countdown to the count provided.
+ */
+ void reset(int32_t count);
+
+ virtual void run() SK_OVERRIDE;
+
+ /**
+ * Blocks until run() has been called count times.
+ */
+ void wait();
+
+private:
+ SkCondVar fReady;
+ int32_t fCount;
+};
+
+#endif