diff options
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/thread_pthread.c b/thread_pthread.c index 84228c8c53..71edee18b0 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -1692,10 +1692,11 @@ int rb_reserved_fd_p(int fd) { #if USE_SLEEPY_TIMER_THREAD - if (fd == timer_thread_pipe.normal[0] || - fd == timer_thread_pipe.normal[1] || - fd == timer_thread_pipe.low[0] || - fd == timer_thread_pipe.low[1]) { + if ((fd == timer_thread_pipe.normal[0] || + fd == timer_thread_pipe.normal[1] || + fd == timer_thread_pipe.low[0] || + fd == timer_thread_pipe.low[1]) && + timer_thread_pipe.owner_process == getpid()) { /* async-signal-safe */ return 1; } else { |