summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 9f723d0d64..dce0ca800f 100644
--- a/thread.c
+++ b/thread.c
@@ -5210,6 +5210,10 @@ ruby_kill(rb_pid_t pid, int sig)
rb_thread_t *th = GET_THREAD();
rb_vm_t *vm = GET_VM();
+ /*
+ * When target pid is self, many caller assume signal will be
+ * delivered immediately and synchronously.
+ */
if ((th == vm->main_thread) && (pid == getpid())) {
GVL_UNLOCK_BEGIN();
native_mutex_lock(&th->interrupt_lock);