aboutsummaryrefslogtreecommitdiffstats
path: root/vm_trace.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-06 07:44:28 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-06 07:44:28 +0000
commit1096d702ed9e4cbc26499fe3749acc7f3609da8f (patch)
treee8d9634d0184a97f1d342a65b20207b03d272b20 /vm_trace.c
parentf0f7f42e8810fe80056df83771004c52fea28b08 (diff)
downloadruby-1096d702ed9e4cbc26499fe3749acc7f3609da8f.tar.gz
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.c20
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;
}