aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/utils/SkCondVar.h
diff options
context:
space:
mode:
authorGravatar henrik.smiding <henrik.smiding@intel.com>2014-07-09 07:25:09 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-07-09 07:25:09 -0700
commita9309f5e5b188bd2d323e115e6b343772ba231aa (patch)
tree8a1828927bad2f3695105140ccc5c3875aa74ae2 /include/utils/SkCondVar.h
parent93cf46f7d687128d2ad05762bd65fea6c4539553 (diff)
Add thread safety configuration check.
Enables the possibility to set thread model in the configuration files (like Android does). Also adds a warning check to make sure that we have an implementation for the thread safety class. Author: joakim.landberg@intel.com Signed-off-by: Henrik Smiding <henrik.smiding@intel.com> R=reed@google.com, mtklein@google.com, tomhudson@google.com, djsollen@google.com, joakim.landberg@intel.com, torne@chromium.org, scroggo@google.com Author: henrik.smiding@intel.com Review URL: https://codereview.chromium.org/361423003
Diffstat (limited to 'include/utils/SkCondVar.h')
-rw-r--r--include/utils/SkCondVar.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/utils/SkCondVar.h b/include/utils/SkCondVar.h
index 861a2aba8a..6f18e1a651 100644
--- a/include/utils/SkCondVar.h
+++ b/include/utils/SkCondVar.h
@@ -8,10 +8,20 @@
#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>
#elif defined(SK_BUILD_FOR_WIN32)
#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!"
#endif
/**