diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-06 07:44:28 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-06 07:44:28 +0000 |
commit | 5dfdaa92994096ac7c6713ebd77413271ff4bc41 (patch) | |
tree | e8d9634d0184a97f1d342a65b20207b03d272b20 /vm_trace.c | |
parent | 5845bd6a718573da5f0f7e53368d2a1dda52f420 (diff) |
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
Diffstat (limited to 'vm_trace.c')
-rw-r--r-- | vm_trace.c | 20 |
1 files changed, 10 insertions, 10 deletions
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; i<index; i++) { pjob = &vm->postponed_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; } |