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/src/utils/SkCondVar.cpp b/src/utils/SkCondVar.cpp
new file mode 100644
index 0000000..8cbab58
--- /dev/null
+++ b/src/utils/SkCondVar.cpp
@@ -0,0 +1,38 @@
+/*
+ * 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 "SkCondVar.h"
+
+SkCondVar::SkCondVar() {
+    pthread_mutex_init(&fMutex, NULL /* default mutex attr */);
+    pthread_cond_init(&fCond, NULL /* default cond attr */);
+}
+
+SkCondVar::~SkCondVar() {
+    pthread_mutex_destroy(&fMutex);
+    pthread_cond_destroy(&fCond);
+}
+
+void SkCondVar::lock() {
+    pthread_mutex_lock(&fMutex);
+}
+
+void SkCondVar::unlock() {
+    pthread_mutex_unlock(&fMutex);
+}
+
+void SkCondVar::wait() {
+    pthread_cond_wait(&fCond, &fMutex);
+}
+
+void SkCondVar::signal() {
+    pthread_cond_signal(&fCond);
+}
+
+void SkCondVar::broadcast() {
+    pthread_cond_broadcast(&fCond);
+}