diff options
author | Nobuyoshi Nakada <[email protected]> | 2022-05-22 14:18:27 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2022-05-22 14:18:27 +0900 |
commit | 009a51466885422f9d15c728f0e39a51908f58df (patch) | |
tree | dc7ac6eef218e5277dec41c3de2e33077c8ace59 /thread_pthread.c | |
parent | 539459abda3f4e086ca060620dee2586ebfed873 (diff) |
Revert broken thread_pthread.c in 539459abda3
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/thread_pthread.c b/thread_pthread.c index 83237e1fe4..b52efe6db9 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -1765,23 +1765,10 @@ native_thread_native_thread_id(rb_thread_t *target_th) if (tid == 0) return Qnil; return INT2FIX(tid); #elif defined(__APPLE__) - #if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 - uint64_t tid; - tid = pthread_mach_thread_np(pthread_self()); - #elif MAC_OS_X_VERSION_MIN_REQUIRED < 1060 - uint64_t tid; - if (&pthread_threadid_np) { - int error = pthread_threadid_np(target_th->thread_id, &tid); - if (error != 0) rb_syserr_fail(error, "pthread_threadid_np"); - } else { - uint64_t tid; - tid = pthread_mach_thread_np(pthread_self()); - } - #else - int error = pthread_threadid_np(target_th->thread_id, &tid); - if (error != 0) rb_syserr_fail(error, "pthread_threadid_np"); - return ULL2NUM((unsigned long long)tid); - #endif + uint64_t tid; + int e = pthread_threadid_np(target_th->nt->thread_id, &tid); + if (e != 0) rb_syserr_fail(e, "pthread_threadid_np"); + return ULL2NUM((unsigned long long)tid); #endif } # define USE_NATIVE_THREAD_NATIVE_THREAD_ID 1 |