aboutsummaryrefslogtreecommitdiff
path: root/assets/blender/gleis/rail_together.png
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2017-01-25 12:27:33 +0100
committerorwell96 <mono96.mml@gmail.com>2017-01-25 16:31:42 +0100
commitae65f9b7f51c2159356ddd26b9f2448ae9331c47 (patch)
tree1a04d2de4016d12cd7f1893e788323be3a54f959 /assets/blender/gleis/rail_together.png
parentbd0a4a51b8b021bd2014e2918330c53ddb0c5796 (diff)
downloadadvtrains-ae65f9b7f51c2159356ddd26b9f2448ae9331c47.tar.gz
advtrains-ae65f9b7f51c2159356ddd26b9f2448ae9331c47.tar.bz2
advtrains-ae65f9b7f51c2159356ddd26b9f2448ae9331c47.zip
update zip
Diffstat (limited to 'assets/blender/gleis/rail_together.png')
0 files changed, 0 insertions, 0 deletions
02110-1301 USA. */ #ifndef THREADS_HEADER #define THREADS_HEADER // // Determine which threading APIs we will use // #if __cplusplus >= 201103L #define USE_CPP11_THREADS 1 #elif defined(_WIN32) #define USE_WIN_THREADS 1 #else #define USE_POSIX_THREADS 1 #endif #if defined(_WIN32) // Prefer critical section API because std::mutex is much slower on Windows #define USE_WIN_MUTEX 1 #elif __cplusplus >= 201103L #define USE_CPP11_MUTEX 1 #else #define USE_POSIX_MUTEX 1 #endif /////////////// #if USE_CPP11_THREADS #include <thread> #elif USE_POSIX_THREADS #include <pthread.h> #else #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include <windows.h> #endif #include "threading/mutex.h" // // threadid_t, threadhandle_t // #if USE_CPP11_THREADS typedef std::thread::id threadid_t; typedef std::thread::native_handle_type threadhandle_t; #elif USE_WIN_THREADS typedef DWORD threadid_t; typedef HANDLE threadhandle_t; #elif USE_POSIX_THREADS typedef pthread_t threadid_t; typedef pthread_t threadhandle_t; #endif // // ThreadStartFunc // #if USE_CPP11_THREADS || USE_POSIX_THREADS typedef void *ThreadStartFunc(void *param); #elif defined(_WIN32_WCE) typedef DWORD ThreadStartFunc(LPVOID param); #elif defined(_WIN32) typedef DWORD WINAPI ThreadStartFunc(LPVOID param); #endif inline threadid_t thr_get_current_thread_id() { #if USE_CPP11_THREADS return std::this_thread::get_id(); #elif USE_WIN_THREADS return GetCurrentThreadId(); #elif USE_POSIX_THREADS return pthread_self(); #endif } inline bool thr_compare_thread_id(threadid_t thr1, threadid_t thr2) { #if USE_POSIX_THREADS return pthread_equal(thr1, thr2); #else return thr1 == thr2; #endif } inline bool thr_is_current_thread(threadid_t thr) { return thr_compare_thread_id(thr_get_current_thread_id(), thr); } #endif