From a9309f5e5b188bd2d323e115e6b343772ba231aa Mon Sep 17 00:00:00 2001 From: "henrik.smiding" Date: Wed, 9 Jul 2014 07:25:09 -0700 Subject: [PATCH] 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 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 --- include/utils/SkCondVar.h | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 #elif defined(SK_BUILD_FOR_WIN32) #include +#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 /**