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
This commit is contained in:
henrik.smiding 2014-07-09 07:25:09 -07:00 committed by Commit bot
parent 93cf46f7d6
commit a9309f5e5b

View File

@ -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
/**