From 5dfdaa92994096ac7c6713ebd77413271ff4bc41 Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 6 Nov 2017 07:44:28 +0000 Subject: move rb_thread_t::interrupt_flag and mask to rb_execution_context_t. * vm_core.h (rb_thread_t): move `rb_thread_t::interrupt_flag` and `rb_thread_t::interrupt_mask` to rb_execution_context_t. RUBY_VM_CHECK_INTS() accepts `ec` instead of `th`. * cont.c (rb_fiber_terminate): to propagate interrupt information, add new parameter `need_interrupt`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_trace.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'vm_trace.c') diff --git a/vm_trace.c b/vm_trace.c index 745fdab8a1..28be72eb9a 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -1540,7 +1540,7 @@ postponed_job_register(rb_thread_t *th, rb_vm_t *vm, pjob->func = func; pjob->data = data; - RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th); + RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th->ec); return PJRR_SUCESS; } @@ -1576,7 +1576,7 @@ rb_postponed_job_register_one(unsigned int flags, rb_postponed_job_func_t func, for (i=0; ipostponed_job_buffer[i]; if (pjob->func == func) { - RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th); + RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th->ec); return 2; } } @@ -1591,16 +1591,16 @@ rb_postponed_job_register_one(unsigned int flags, rb_postponed_job_func_t func, void rb_postponed_job_flush(rb_vm_t *vm) { - rb_thread_t * volatile th = GET_THREAD(); + rb_execution_context_t *ec = GET_EC(); const unsigned long block_mask = POSTPONED_JOB_INTERRUPT_MASK|TRAP_INTERRUPT_MASK; - volatile unsigned long saved_mask = th->interrupt_mask & block_mask; - VALUE volatile saved_errno = th->ec->errinfo; + volatile unsigned long saved_mask = ec->interrupt_mask & block_mask; + VALUE volatile saved_errno = ec->errinfo; - th->ec->errinfo = Qnil; + ec->errinfo = Qnil; /* mask POSTPONED_JOB dispatch */ - th->interrupt_mask |= block_mask; + ec->interrupt_mask |= block_mask; { - EC_PUSH_TAG(th->ec); + EC_PUSH_TAG(ec); if (EXEC_TAG() == TAG_NONE) { int index; while ((index = vm->postponed_job_index) > 0) { @@ -1613,6 +1613,6 @@ rb_postponed_job_flush(rb_vm_t *vm) EC_POP_TAG(); } /* restore POSTPONED_JOB mask */ - th->interrupt_mask &= ~(saved_mask ^ block_mask); - th->ec->errinfo = saved_errno; + ec->interrupt_mask &= ~(saved_mask ^ block_mask); + ec->errinfo = saved_errno; } -- cgit v1.2.3