mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Revert broken thread_pthread.c in 539459abda
This commit is contained in:
parent
539459abda
commit
009a514668
1 changed files with 4 additions and 17 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue