diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/thread_calls.c | 12 | ||||
-rw-r--r-- | common/thread_calls.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/common/thread_calls.c b/common/thread_calls.c index c28febdf..6e40faae 100644 --- a/common/thread_calls.c +++ b/common/thread_calls.c @@ -75,6 +75,18 @@ tc_get_threadid(void) } /*****************************************************************************/ +/* returns boolean */ +int APP_CC +tc_threadid_equal(tbus tid1, tbus tid2) +{ +#if defined(_WIN32) + return tid1 == tid2; +#else + return pthread_equal((pthread_t)tid1, (pthread_t)tid2); +#endif +} + +/*****************************************************************************/ tbus APP_CC tc_mutex_create(void) { diff --git a/common/thread_calls.h b/common/thread_calls.h index 350a125a..d6805448 100644 --- a/common/thread_calls.h +++ b/common/thread_calls.h @@ -32,6 +32,8 @@ int APP_CC tc_thread_create(THREAD_RV (THREAD_CC * start_routine)(void*), void* arg); tbus APP_CC tc_get_threadid(void); +int APP_CC +tc_threadid_equal(tbus tid1, tbus tid2); tbus APP_CC tc_mutex_create(void); void APP_CC |