summaryrefslogtreecommitdiff
path: root/thread_sync.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-06 07:44:28 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-06 07:44:28 (GMT)
commit5dfdaa92994096ac7c6713ebd77413271ff4bc41 (patch)
treee8d9634d0184a97f1d342a65b20207b03d272b20 /thread_sync.c
parent5845bd6a718573da5f0f7e53368d2a1dda52f420 (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 'thread_sync.c')
-rw-r--r--thread_sync.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/thread_sync.c b/thread_sync.c
index 3316bcb..6eff5e7 100644
--- a/thread_sync.c
+++ b/thread_sync.c
@@ -237,7 +237,7 @@ rb_mutex_lock(VALUE self)
/* When running trap handler */
if (!FL_TEST_RAW(self, MUTEX_ALLOW_TRAP) &&
- th->interrupt_mask & TRAP_INTERRUPT_MASK) {
+ th->ec->interrupt_mask & TRAP_INTERRUPT_MASK) {
rb_raise(rb_eThreadError, "can't be called from trap context");
}
@@ -280,7 +280,7 @@ rb_mutex_lock(VALUE self)
patrol_thread = NULL;
th->locking_mutex = Qfalse;
- if (mutex->th && timeout && !RUBY_VM_INTERRUPTED(th)) {
+ if (mutex->th && timeout && !RUBY_VM_INTERRUPTED(th->ec)) {
rb_check_deadlock(th->vm);
}
if (th->status == THREAD_STOPPED_FOREVER) {
@@ -290,7 +290,7 @@ rb_mutex_lock(VALUE self)
if (mutex->th == th) mutex_locked(th, self);
- RUBY_VM_CHECK_INTS_BLOCKING(th);
+ RUBY_VM_CHECK_INTS_BLOCKING(th->ec);
}
}
return self;