summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-17 02:06:54 (GMT)
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-17 02:06:54 (GMT)
commit8b6297e56d7f86b833e7a9fbb0c45bf41ca4b7e9 (patch)
treed27736a542823519d0f9a7b5a974387c53df34be /thread_pthread.c
parent028cda35c7f3ae51a1d7b9791f8a274a15dbd267 (diff)
thread_pthread.c (rb_sigwait_fd_get): skip getpid check
This is not called in signal handlers, so there's no reason for it. glibc 2.25+ no longer caches getpid(), so it will cost a syscall for those users. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 21266fd..af933d4 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1866,11 +1866,8 @@ rb_sleep_cond_put(rb_nativethread_cond_t *cond)
int
rb_sigwait_fd_get(const rb_thread_t *th)
{
- rb_pid_t current = getpid();
-
- if (signal_self_pipe.owner_process == current &&
- signal_self_pipe.normal[0] >= 0) {
-
+ if (signal_self_pipe.normal[0] >= 0) {
+ VM_ASSERT(signal_self_pipe.owner_process == getpid());
/*
* no need to keep firing the timer if any thread is sleeping
* on the signal self-pipe