cosmetic change

This commit is contained in:
Koichi Sasada 2023-03-30 03:15:14 +09:00
parent f89c348234
commit ba72849a3f
Notes: git 2023-03-30 05:56:29 +00:00

View File

@ -342,26 +342,31 @@ unblock_function_clear(rb_thread_t *th)
static void static void
rb_threadptr_interrupt_common(rb_thread_t *th, int trap) rb_threadptr_interrupt_common(rb_thread_t *th, int trap)
{ {
rb_native_mutex_lock(&th->interrupt_lock); RUBY_DEBUG_LOG("th:%u trap:%d", rb_th_serial(th), trap);
rb_native_mutex_lock(&th->interrupt_lock);
{
if (trap) { if (trap) {
RUBY_VM_SET_TRAP_INTERRUPT(th->ec); RUBY_VM_SET_TRAP_INTERRUPT(th->ec);
} }
else { else {
RUBY_VM_SET_INTERRUPT(th->ec); RUBY_VM_SET_INTERRUPT(th->ec);
} }
if (th->unblock.func != NULL) { if (th->unblock.func != NULL) {
(th->unblock.func)(th->unblock.arg); (th->unblock.func)(th->unblock.arg);
} }
else { else {
/* none */ /* none */
} }
}
rb_native_mutex_unlock(&th->interrupt_lock); rb_native_mutex_unlock(&th->interrupt_lock);
} }
void void
rb_threadptr_interrupt(rb_thread_t *th) rb_threadptr_interrupt(rb_thread_t *th)
{ {
RUBY_DEBUG_LOG("th:%u", rb_th_serial(th));
rb_threadptr_interrupt_common(th, 0); rb_threadptr_interrupt_common(th, 0);
} }