mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
thread_pthread.c: do not wakeup inside child processes
* thread_pthread.c (rb_thread_wakeup_timer_thread): check ownership before incrementing (rb_thread_wakeup_timer_thread_low): ditto [Bug #13794] [ruby-core:83064] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8efc41329d
commit
b860f06413
1 changed files with 10 additions and 6 deletions
|
@ -1318,17 +1318,21 @@ void
|
|||
rb_thread_wakeup_timer_thread(void)
|
||||
{
|
||||
/* must be safe inside sighandler, so no mutex */
|
||||
ATOMIC_INC(timer_thread_pipe.writing);
|
||||
rb_thread_wakeup_timer_thread_fd(&timer_thread_pipe.normal[1]);
|
||||
ATOMIC_DEC(timer_thread_pipe.writing);
|
||||
if (timer_thread_pipe.owner_process == getpid()) {
|
||||
ATOMIC_INC(timer_thread_pipe.writing);
|
||||
rb_thread_wakeup_timer_thread_fd(&timer_thread_pipe.normal[1]);
|
||||
ATOMIC_DEC(timer_thread_pipe.writing);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
rb_thread_wakeup_timer_thread_low(void)
|
||||
{
|
||||
ATOMIC_INC(timer_thread_pipe.writing);
|
||||
rb_thread_wakeup_timer_thread_fd(&timer_thread_pipe.low[1]);
|
||||
ATOMIC_DEC(timer_thread_pipe.writing);
|
||||
if (timer_thread_pipe.owner_process == getpid()) {
|
||||
ATOMIC_INC(timer_thread_pipe.writing);
|
||||
rb_thread_wakeup_timer_thread_fd(&timer_thread_pipe.low[1]);
|
||||
ATOMIC_DEC(timer_thread_pipe.writing);
|
||||
}
|
||||
}
|
||||
|
||||
/* VM-dependent API is not available for this function */
|
||||
|
|
Loading…
Add table
Reference in a new issue