Revert broken thread_pthread.c in 539459abda3
This commit is contained in:
parent
539459abda
commit
009a514668
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user