From abfd87c2305a0a07bd5958be2282fcc2fa10a639 Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 13 Aug 2008 21:26:49 +0000 Subject: * thread.c (rb_thread_execute_interrupts): switch event should be occur only once. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'thread.c') diff --git a/thread.c b/thread.c index e30e4e33d7..5032f773ef 100644 --- a/thread.c +++ b/thread.c @@ -1015,16 +1015,13 @@ rb_thread_execute_interrupts(rb_thread_t *th) } if (timer_interrupt) { -#if USE_NATIVE_THREAD_PRIORITY EXEC_EVENT_HOOK(th, RUBY_EVENT_SWITCH, th->cfp->self, 0, 0); - rb_thread_schedule(); -#else + if (th->slice > 0) { th->slice--; } else { reschedule: - EXEC_EVENT_HOOK(th, RUBY_EVENT_SWITCH, th->cfp->self, 0, 0); rb_thread_schedule(); if (th->slice < 0) { th->slice++; @@ -1034,7 +1031,6 @@ rb_thread_execute_interrupts(rb_thread_t *th) th->slice = th->priority; } } -#endif } } } -- cgit v1.2.3