aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/thread.c b/thread.c
index dce0ca800f..e9fe8a7ddf 100644
--- a/thread.c
+++ b/thread.c
@@ -5214,14 +5214,15 @@ ruby_kill(rb_pid_t pid, int sig)
* When target pid is self, many caller assume signal will be
* delivered immediately and synchronously.
*/
- if ((th == vm->main_thread) && (pid == getpid())) {
+ if ((sig != 0) && (th == vm->main_thread) && (pid == getpid())) {
GVL_UNLOCK_BEGIN();
native_mutex_lock(&th->interrupt_lock);
err = kill(pid, sig);
native_cond_wait(&th->interrupt_cond, &th->interrupt_lock);
native_mutex_unlock(&th->interrupt_lock);
GVL_UNLOCK_END();
- } else {
+ }
+ else {
err = kill(pid, sig);
}
if (err < 0)