Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Unified Diff: src/utils/SkCondVar.h

Issue 700683002: Manually load CONDITION_VARIABLE methods on Windows, checking for failure (XP). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: winapi Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkTaskGroup.cpp ('k') | src/utils/SkCondVar.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkCondVar.h
diff --git a/src/utils/SkCondVar.h b/src/utils/SkCondVar.h
index 6f18e1a651df9e0443d00f1a6f3ba9ae9461e5c9..7f4225c66ac1d9550e428efc8ab43979ec3f3911 100644
--- a/src/utils/SkCondVar.h
+++ b/src/utils/SkCondVar.h
@@ -8,31 +8,29 @@
#ifndef SkCondVar_DEFINED
#define SkCondVar_DEFINED
-/**
- * Import any thread model setting from configuration files.
- */
#include "SkTypes.h"
#ifdef SK_USE_POSIX_THREADS
-#include <pthread.h>
+ #include <pthread.h>
#elif defined(SK_BUILD_FOR_WIN32)
-#include <windows.h>
+ #include <windows.h>
#else
-/**
- * Warn if the implementation of this class is empty, i.e. thread safety is not working.
- */
-#warning "Thread safety class SkCondVar has no implementation!"
+ #error "SkCondVar requires pthreads or Windows."
#endif
/**
* Condition variable for blocking access to shared data from other threads and
* controlling which threads are awake.
*
- * Currently only supported on platforms with posix threads and Windows Vista and
- * above.
+ * Currently only supported on platforms with posix threads and Windows Vista and above.
*/
class SkCondVar {
public:
+ /** Returns true if it makes sense to create and use SkCondVars.
+ * You _MUST_ call this method and it must return true before creating any SkCondVars.
+ */
+ static bool Supported();
+
SkCondVar();
~SkCondVar();
« no previous file with comments | « src/core/SkTaskGroup.cpp ('k') | src/utils/SkCondVar.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698