aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils/SkCondVar.h
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-01-21 19:51:27 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-21 19:51:27 -0800
commit4daa6f613cb7d8a3c07369af3e919ea65405ec55 (patch)
treec46b7e2e4ef4875532a0f1a37b3e95adfdfb3c53 /src/utils/SkCondVar.h
parent55e88b226ccb85d2c712a9e3e9e1f5bdcaac05ac (diff)
Don't require -DSK_USE_POSIX_THREADS.
To compile SkCondVar, we already require either pthreads or Windows. This simplifies that code to not need SK_USE_POSIX_THREADS to be explicitly defined. We'll just look to see if we're targeting Windows, and if not, assume pthreads. Both before and after this CL, that code will fail to compile if we're not on Windows and don't have pthreads. BUG=skia: Review URL: https://codereview.chromium.org/869443003
Diffstat (limited to 'src/utils/SkCondVar.h')
-rw-r--r--src/utils/SkCondVar.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/utils/SkCondVar.h b/src/utils/SkCondVar.h
index 7f4225c66a..0a9f94f0ab 100644
--- a/src/utils/SkCondVar.h
+++ b/src/utils/SkCondVar.h
@@ -10,12 +10,10 @@
#include "SkTypes.h"
-#ifdef SK_USE_POSIX_THREADS
- #include <pthread.h>
-#elif defined(SK_BUILD_FOR_WIN32)
+#ifdef SK_BUILD_FOR_WIN32
#include <windows.h>
#else
- #error "SkCondVar requires pthreads or Windows."
+ #include <pthread.h>
#endif
/**
@@ -64,12 +62,12 @@ public:
void broadcast();
private:
-#ifdef SK_USE_POSIX_THREADS
- pthread_mutex_t fMutex;
- pthread_cond_t fCond;
-#elif defined(SK_BUILD_FOR_WIN32)
+#ifdef SK_BUILD_FOR_WIN32
CRITICAL_SECTION fCriticalSection;
CONDITION_VARIABLE fCondition;
+#else
+ pthread_mutex_t fMutex;
+ pthread_cond_t fCond;
#endif
};