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
diff --git a/include/utils/SkCondVar.h b/include/utils/SkCondVar.h
index 861a2ab..6f18e1a 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
/**