thread_pthread.c (ubf_timer_destroy): remove redundant getpid check

TIMER_THREAD_CREATED_P already checks that pid, and glibc 2.25+
no longer caches getpid(2).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2018-08-23 19:49:35 +00:00
parent f3bf0e1bef
commit 7bde63fad6

View File

@ -1714,17 +1714,14 @@ static void
ubf_timer_destroy(void) ubf_timer_destroy(void)
{ {
#if UBF_TIMER == UBF_TIMER_PTHREAD #if UBF_TIMER == UBF_TIMER_PTHREAD
rb_pid_t current = getpid(); int err;
if (timer_pthread.owner == current) {
int err;
timer_pthread.owner = 0; timer_pthread.owner = 0;
ubf_timer_disarm(); ubf_timer_disarm();
rb_thread_wakeup_timer_thread_fd(timer_pthread.low[1]); rb_thread_wakeup_timer_thread_fd(timer_pthread.low[1]);
err = pthread_join(timer_pthread.thid, 0); err = pthread_join(timer_pthread.thid, 0);
if (err) { if (err) {
rb_raise(rb_eThreadError, "native_thread_join() failed (%d)", err); rb_raise(rb_eThreadError, "native_thread_join() failed (%d)", err);
}
} }
#endif #endif
/* no need to destroy real POSIX timers */ /* no need to destroy real POSIX timers */