зеркало из https://github.com/github/ruby.git
* thread.c (rb_thread_terminate_all): do not ignore interrupt when
reaping threads on termination. [ruby-dev:39107] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
ce46bc6345
Коммит
ec5e3c551d
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Aug 20 08:39:50 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* thread.c (rb_thread_terminate_all): do not ignore interrupt when
|
||||||
|
reaping threads on termination. [ruby-dev:39107]
|
||||||
|
|
||||||
Thu Aug 20 02:32:08 2009 Tanaka Akira <akr@fsij.org>
|
Thu Aug 20 02:32:08 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* enumerator.c (next_init): don't clear feedvalue.
|
* enumerator.c (next_init): don't clear feedvalue.
|
||||||
|
|
12
thread.c
12
thread.c
|
@ -298,6 +298,9 @@ rb_thread_terminate_all(void)
|
||||||
{
|
{
|
||||||
rb_thread_t *th = GET_THREAD(); /* main thread */
|
rb_thread_t *th = GET_THREAD(); /* main thread */
|
||||||
rb_vm_t *vm = th->vm;
|
rb_vm_t *vm = th->vm;
|
||||||
|
VALUE einfo = vm->main_thread->errinfo;
|
||||||
|
int state;
|
||||||
|
|
||||||
if (vm->main_thread != th) {
|
if (vm->main_thread != th) {
|
||||||
rb_bug("rb_thread_terminate_all: called by child thread (%p, %p)",
|
rb_bug("rb_thread_terminate_all: called by child thread (%p, %p)",
|
||||||
(void *)vm->main_thread, (void *)th);
|
(void *)vm->main_thread, (void *)th);
|
||||||
|
@ -313,13 +316,14 @@ rb_thread_terminate_all(void)
|
||||||
|
|
||||||
while (!rb_thread_alone()) {
|
while (!rb_thread_alone()) {
|
||||||
PUSH_TAG();
|
PUSH_TAG();
|
||||||
if (EXEC_TAG() == 0) {
|
if ((state = EXEC_TAG()) == 0) {
|
||||||
rb_thread_schedule();
|
rb_thread_schedule();
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
/* ignore exception */
|
|
||||||
}
|
|
||||||
POP_TAG();
|
POP_TAG();
|
||||||
|
if (state && einfo != vm->main_thread->errinfo &&
|
||||||
|
RUBY_VM_SET_INTERRUPT(vm->main_thread)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
rb_thread_stop_timer_thread();
|
rb_thread_stop_timer_thread();
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче