summaryrefslogtreecommitdiff
path: root/vm_trace.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-13 11:41:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-13 11:41:57 +0000
commit05459d1a33db59c47e98e327c9f52808ebc76a3f (patch)
tree9cda5c7342db1004a507d09ba6be4d332e7ed5dd /vm_trace.c
parent6447d061f52178ba3cd5f8f463a0f7a46eee3a9a (diff)
vm_trace.c: defer interrupts while postponed jobs
* vm_trace.c (rb_postponed_job_flush): mask signal trap interrupt too to defer handling after finalizers finished. [ruby-core:66825] [Bug #10595] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_trace.c')
-rw-r--r--vm_trace.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/vm_trace.c b/vm_trace.c
index a11ee77..e50ea99 100644
--- a/vm_trace.c
+++ b/vm_trace.c
@@ -1554,12 +1554,13 @@ void
rb_postponed_job_flush(rb_vm_t *vm)
{
rb_thread_t *th = GET_THREAD();
- unsigned long saved_postponed_job_interrupt_mask = th->interrupt_mask & POSTPONED_JOB_INTERRUPT_MASK;
+ const unsigned long block_mask = POSTPONED_JOB_INTERRUPT_MASK|TRAP_INTERRUPT_MASK;
+ unsigned long saved_mask = th->interrupt_mask & block_mask;
VALUE saved_errno = th->errinfo;
th->errinfo = Qnil;
/* mask POSTPONED_JOB dispatch */
- th->interrupt_mask |= POSTPONED_JOB_INTERRUPT_MASK;
+ th->interrupt_mask |= block_mask;
{
TH_PUSH_TAG(th);
EXEC_TAG();
@@ -1575,6 +1576,6 @@ rb_postponed_job_flush(rb_vm_t *vm)
TH_POP_TAG();
}
/* restore POSTPONED_JOB mask */
- th->interrupt_mask &= ~(saved_postponed_job_interrupt_mask ^ POSTPONED_JOB_INTERRUPT_MASK);
+ th->interrupt_mask &= ~(saved_mask ^ block_mask);
th->errinfo = saved_errno;
}