From 2e72d1c3236c8ec1c0cb8f35c1dd6b64fde02fce Mon Sep 17 00:00:00 2001 From: kosaki Date: Fri, 30 Nov 2012 13:52:24 +0000 Subject: [PATCH] revert r35486 (add rb_thread_t#yeiling field). because it doesn't help to close a race. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 16 ---------------- thread.c | 6 +----- vm_core.h | 1 - 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6241b4b7bf..f40bc37c76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10257,22 +10257,6 @@ Sun Apr 29 06:12:02 2012 Nobuyoshi Nakada * vm.c (m_core_hash_merge_kwd): merge keyword hash into intermediate hash. leftward argument is prior currently. -Sat Apr 28 18:39:40 2012 Koichi Sasada - - * vm_core.h (rb_thread_t#yielding): add a field. - - * thread.c (rb_thread_schedule_limits): set th#yielding while - release GVL to yield CPU time. - - * thread.c (timer_thread_function): skip timer interrupt when - th#yielding is true. This patch fixes r35480. - - * thread.c (rb_threadptr_execute_interrupts_common): revert - a patch of r35480. - - * ChangeLog: add an extended memo of r35480. - http://bugs.ruby-lang.org/projects/ruby-trunk/wiki/R35480_ExtendedMemo - Fri Apr 27 12:34:23 2012 NAKAMURA Usaku * ext/dl/cfunc.c (rb_dlcfunc_call): should convert a Bignum value to diff --git a/thread.c b/thread.c index 47ed9e0ed2..5a97b5202f 100644 --- a/thread.c +++ b/thread.c @@ -1047,10 +1047,8 @@ rb_thread_schedule_limits(unsigned long limits_us) if (th->running_time_us >= limits_us) { thread_debug("rb_thread_schedule/switch start\n"); - th->yielding = 1; RB_GC_SAVE_MACHINE_CONTEXT(th); gvl_yield(th->vm, th); - th->yielding = 0; rb_thread_set_current(th); thread_debug("rb_thread_schedule/switch done\n"); } @@ -3635,9 +3633,7 @@ timer_thread_function(void *arg) rb_vm_t *vm = GET_VM(); /* TODO: fix me for Multi-VM */ /* for time slice */ - if (!vm->running_thread->yielding) { - RUBY_VM_SET_TIMER_INTERRUPT(vm->running_thread); - } + RUBY_VM_SET_TIMER_INTERRUPT(vm->running_thread); /* check signal */ rb_threadptr_check_signal(vm->main_thread); diff --git a/vm_core.h b/vm_core.h index 444dfe7c87..96b55c4931 100644 --- a/vm_core.h +++ b/vm_core.h @@ -478,7 +478,6 @@ typedef struct rb_thread_struct { /* passing state */ int state; - int yielding; int waiting_fd;