diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-23 19:49:35 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-23 19:49:35 +0000 |
commit | a55e66e91893312d924ac690bd1dc7e7152a98e1 (patch) | |
tree | 90ce328b2749337c0934dcf2bd35c9ce8f87002f /thread_pthread.c | |
parent | f58853516c2eda2b6b6895f26055d3262c04b78f (diff) | |
download | ruby-a55e66e91893312d924ac690bd1dc7e7152a98e1.tar.gz |
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
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/thread_pthread.c b/thread_pthread.c index 2923c1514c..64b2684c22 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -1714,17 +1714,14 @@ static void ubf_timer_destroy(void) { #if UBF_TIMER == UBF_TIMER_PTHREAD - rb_pid_t current = getpid(); - if (timer_pthread.owner == current) { - int err; + int err; - timer_pthread.owner = 0; - ubf_timer_disarm(); - rb_thread_wakeup_timer_thread_fd(timer_pthread.low[1]); - err = pthread_join(timer_pthread.thid, 0); - if (err) { - rb_raise(rb_eThreadError, "native_thread_join() failed (%d)", err); - } + timer_pthread.owner = 0; + ubf_timer_disarm(); + rb_thread_wakeup_timer_thread_fd(timer_pthread.low[1]); + err = pthread_join(timer_pthread.thid, 0); + if (err) { + rb_raise(rb_eThreadError, "native_thread_join() failed (%d)", err); } #endif /* no need to destroy real POSIX timers */ |