mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
028cda35c7
commit
8b6297e56d
1 changed files with 2 additions and 5 deletions
|
@ -1866,11 +1866,8 @@ rb_sleep_cond_put(rb_nativethread_cond_t *cond)
|
||||||
int
|
int
|
||||||
rb_sigwait_fd_get(const rb_thread_t *th)
|
rb_sigwait_fd_get(const rb_thread_t *th)
|
||||||
{
|
{
|
||||||
rb_pid_t current = getpid();
|
if (signal_self_pipe.normal[0] >= 0) {
|
||||||
|
VM_ASSERT(signal_self_pipe.owner_process == getpid());
|
||||||
if (signal_self_pipe.owner_process == current &&
|
|
||||||
signal_self_pipe.normal[0] >= 0) {
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* no need to keep firing the timer if any thread is sleeping
|
* no need to keep firing the timer if any thread is sleeping
|
||||||
* on the signal self-pipe
|
* on the signal self-pipe
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue