forked from organicmaps/organicmaps-tmp
Convenient macro for thread checker to use it once in-place.
This commit is contained in:
parent
5d8f3914f6
commit
0faa81ef57
1 changed files with 5 additions and 0 deletions
|
@ -26,7 +26,12 @@ private:
|
|||
#if defined(DEBUG)
|
||||
#define DECLARE_THREAD_CHECKER(threadCheckerName) ThreadChecker threadCheckerName
|
||||
#define ASSERT_THREAD_CHECKER(threadCheckerName, msg) ASSERT(threadCheckerName.CalledOnOriginalThread(), msg)
|
||||
#define DECLARE_AND_ASSERT_THREAD_CHECKER(msg) { \
|
||||
static const ThreadChecker threadChecker; \
|
||||
ASSERT(threadChecker.CalledOnOriginalThread(), (msg)); \
|
||||
}
|
||||
#else
|
||||
#define DECLARE_THREAD_CHECKER(threadCheckerName)
|
||||
#define ASSERT_THREAD_CHECKER(threadCheckerName, msg)
|
||||
#define DECLARE_AND_ASSERT_THREAD_CHECKER(msg)
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue