Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef CLASP_UTIL_THREAD_H_INCLUDED
00022 #define CLASP_UTIL_THREAD_H_INCLUDED
00023
00024 #if WITH_THREADS
00025 #if _WIN32||_WIN64
00026 #define WIN32_LEAN_AND_MEAN // exclude APIs such as Cryptography, DDE, RPC, Shell, and Windows Sockets.
00027 #define NOMINMAX // do not let windows.h define macros min and max
00028 #endif
00029 #include <tbb/tbb_thread.h>
00030 namespace Clasp {
00031 typedef tbb::tbb_thread thread;
00032 namespace this_thread {
00033 using tbb::this_tbb_thread::yield;
00034 }
00035 }
00036 #else
00037 namespace no_multi_threading {
00038 struct thread {};
00039 inline void yield() {}
00040 }
00041 namespace Clasp {
00042 typedef no_multi_threading::thread thread;
00043 namespace this_thread { using no_multi_threading::yield; }
00044 }
00045 #endif
00046
00047 #endif