* thread.c (ruby_kill): release GVL while waiting signal delivered.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d617690a65
commit
c9073822c2
@ -1,3 +1,7 @@
|
|||||||
|
Sat Mar 16 03:36:56 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
|
* thread.c (ruby_kill): release GVL while waiting signal delivered.
|
||||||
|
|
||||||
Tue Mar 19 19:50:48 2013 NAKAMURA Usaku <usa@ruby-lang.org>
|
Tue Mar 19 19:50:48 2013 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* ruby_kill (internal.h, thread.c): use rb_pid_t instead of pid_t.
|
* ruby_kill (internal.h, thread.c): use rb_pid_t instead of pid_t.
|
||||||
|
2
thread.c
2
thread.c
@ -5211,10 +5211,12 @@ ruby_kill(rb_pid_t pid, int sig)
|
|||||||
rb_vm_t *vm = GET_VM();
|
rb_vm_t *vm = GET_VM();
|
||||||
|
|
||||||
if ((th == vm->main_thread) && (pid == getpid())) {
|
if ((th == vm->main_thread) && (pid == getpid())) {
|
||||||
|
GVL_UNLOCK_BEGIN();
|
||||||
native_mutex_lock(&th->interrupt_lock);
|
native_mutex_lock(&th->interrupt_lock);
|
||||||
err = kill(pid, sig);
|
err = kill(pid, sig);
|
||||||
native_cond_wait(&th->interrupt_cond, &th->interrupt_lock);
|
native_cond_wait(&th->interrupt_cond, &th->interrupt_lock);
|
||||||
native_mutex_unlock(&th->interrupt_lock);
|
native_mutex_unlock(&th->interrupt_lock);
|
||||||
|
GVL_UNLOCK_END();
|
||||||
} else {
|
} else {
|
||||||
err = kill(pid, sig);
|
err = kill(pid, sig);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user