aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2023-03-30 03:15:14 +0900
committerKoichi Sasada <ko1@atdot.net>2023-03-30 14:56:10 +0900
commitba72849a3f5d2369821dfecbb5bf60b9a0e7cd4e (patch)
treeeaa0e97797bd706528092e31eddf46d2119715fc /thread.c
parentf89c34823423f5e1fb69f1896e956a8a61b8c54a (diff)
downloadruby-ba72849a3f5d2369821dfecbb5bf60b9a0e7cd4e.tar.gz
cosmetic change
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/thread.c b/thread.c
index 4ea9716139..81be9fb03b 100644
--- a/thread.c
+++ b/thread.c
@@ -342,19 +342,23 @@ unblock_function_clear(rb_thread_t *th)
static void
rb_threadptr_interrupt_common(rb_thread_t *th, int trap)
{
+ RUBY_DEBUG_LOG("th:%u trap:%d", rb_th_serial(th), trap);
+
rb_native_mutex_lock(&th->interrupt_lock);
+ {
+ if (trap) {
+ RUBY_VM_SET_TRAP_INTERRUPT(th->ec);
+ }
+ else {
+ RUBY_VM_SET_INTERRUPT(th->ec);
+ }
- if (trap) {
- RUBY_VM_SET_TRAP_INTERRUPT(th->ec);
- }
- else {
- RUBY_VM_SET_INTERRUPT(th->ec);
- }
- if (th->unblock.func != NULL) {
- (th->unblock.func)(th->unblock.arg);
- }
- else {
- /* none */
+ if (th->unblock.func != NULL) {
+ (th->unblock.func)(th->unblock.arg);
+ }
+ else {
+ /* none */
+ }
}
rb_native_mutex_unlock(&th->interrupt_lock);
}
@@ -362,6 +366,7 @@ rb_threadptr_interrupt_common(rb_thread_t *th, int trap)
void
rb_threadptr_interrupt(rb_thread_t *th)
{
+ RUBY_DEBUG_LOG("th:%u", rb_th_serial(th));
rb_threadptr_interrupt_common(th, 0);
}