From da06c63c66cd9901be498ab4a970332fbbeeceeb Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 14 Feb 2007 02:42:11 +0000 Subject: [PATCH] * thread.c (set_unblock_function): fix function interface. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ thread.c | 15 +++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0179f9d8c3..461c3980a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Feb 14 11:39:18 2007 Koichi Sasada + + * thread.c (set_unblock_function): fix function interface. + Wed Feb 14 11:12:02 2007 Koichi Sasada * eval_load.c, yarvcore.h: use rb_vm_t#loaded_features instead of diff --git a/thread.c b/thread.c index 96ffd2a863..c22efd41b4 100644 --- a/thread.c +++ b/thread.c @@ -76,7 +76,7 @@ st_delete_wrap(st_table * table, VALUE key) #define THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION -static void set_unblock_function(rb_thread_t *th, rb_unblock_function_t *func, int is_return); +static void set_unblock_function(rb_thread_t *th, rb_unblock_function_t *func); static void clear_unblock_function(rb_thread_t *th); NOINLINE(void rb_gc_set_stack_end(VALUE **stack_end_p)); @@ -95,7 +95,7 @@ NOINLINE(void rb_gc_save_machine_context(rb_thread_t *)); #define BLOCKING_REGION(exec, ubf) do { \ rb_thread_t *__th = GET_THREAD(); \ int __prev_status = __th->status; \ - set_unblock_function(__th, ubf, 0); \ + set_unblock_function(__th, ubf); \ __th->status = THREAD_STOPPED; \ GVL_UNLOCK_BEGIN(); {\ exec; \ @@ -160,20 +160,15 @@ thread_debug(const char *fmt, ...) static void -set_unblock_function(rb_thread_t *th, rb_unblock_function_t *func, int is_return) +set_unblock_function(rb_thread_t *th, rb_unblock_function_t *func) { check_ints: - RUBY_VM_CHECK_INTS(); + RUBY_VM_CHECK_INTS(); /* check signal or so */ native_mutex_lock(&th->interrupt_lock); if (th->interrupt_flag) { native_mutex_unlock(&th->interrupt_lock); - if (is_return) { - return; - } - else { goto check_ints; } - } else { th->unblock_function = func; } @@ -193,7 +188,6 @@ rb_thread_interrupt(rb_thread_t *th) { native_mutex_lock(&th->interrupt_lock); th->interrupt_flag = 1; - if (th->unblock_function) { (th->unblock_function)(th); } @@ -398,6 +392,7 @@ thread_join(rb_thread_t *target_th, double delay) GET_THROWOBJ_STATE(err), GET_THROWOBJ_VAL(err))); } else { + /* normal exception */ rb_exc_raise(err); } }