From 10575a7ee241c9986822d9cf3e048964b4c8f5ad Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 25 Dec 2007 04:16:06 +0000 Subject: * vm_core.h, thread.c, cont.c: add RUBY_VM_SET_INTERRUPT(), RUBY_VM_SET_TIMER_INTERRUPT(), RUBY_VM_INTERRUPTED(). * thread.c, thread_pthread.c, thread_win32.c: fix to ignore time slice event until sleep. * bootstraptest/test_thread.rb: add a test for time limited join test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'thread.c') diff --git a/thread.c b/thread.c index ae0c3b3bf..a96806d77 100644 --- a/thread.c +++ b/thread.c @@ -218,7 +218,7 @@ static void rb_thread_interrupt(rb_thread_t *th) { native_mutex_lock(&th->interrupt_lock); - th->interrupt_flag = 1; + RUBY_VM_SET_INTERRUPT(th); if (th->unblock_function) { (th->unblock_function)(th->unblock_function_arg); } @@ -562,6 +562,7 @@ thread_join_m(int argc, VALUE *argv, VALUE self) if (!NIL_P(limit)) { delay = rb_num2dbl(limit); } + return thread_join(target_th, delay); } @@ -607,7 +608,6 @@ static void sleep_forever(rb_thread_t *th) { native_sleep(th, 0); - RUBY_VM_CHECK_INTS(); } static void @@ -1924,7 +1924,7 @@ timer_thread_function(void) rb_vm_t *vm = GET_VM(); /* TODO: fix me for Multi-VM */ /* for time slice */ - vm->running_thread->interrupt_flag = 1; + RUBY_VM_SET_TIMER_INTERRUPT(vm->running_thread); /* check signal */ if (vm->buffered_signal_size && vm->main_thread->exec_signal == 0) { -- cgit