mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-11-30 02:47:56 +08:00
thread_self on MACOSX should be handled specially.
This commit is contained in:
parent
b1dfd6bdd3
commit
29ede19711
@ -49,6 +49,10 @@ void* thread::thread_run(void* arg)
|
||||
thr->thread_id_ = GetCurrentThreadId();
|
||||
#elif defined(ACL_FREEBSD)
|
||||
thr->thread_id_ = pthread_getthreadid_np();
|
||||
#elif defined(ACL_MACOSX)
|
||||
unsigned long long n;
|
||||
(void) pthread_threadid_np(NULL, &n);
|
||||
thr->thread_id_ = (unsigned long) n;
|
||||
#else
|
||||
thr->thread_id_ = (unsigned long) pthread_self();
|
||||
#endif
|
||||
@ -168,6 +172,10 @@ unsigned long thread::thread_self()
|
||||
{
|
||||
#ifdef ACL_FREEBSD
|
||||
return (unsigned long) pthread_getthreadid_np();
|
||||
#elif defined(ACL_MACOSX)
|
||||
unsigned long long n;
|
||||
(void) pthread_threadid_np(NULL, &n);
|
||||
return (unsigned long) n;
|
||||
#else
|
||||
return (unsigned long) acl_pthread_self();
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user