From 3453b2bd0e186788bb81deff5d723cf48e10881f Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 20 Nov 2007 10:47:53 +0000 Subject: * gc.h, vm_core.h: decl of rb_gc_save_machine_context() should be at vm_core.h. * include/ruby/ruby.h, intern.h: remove type rb_thread_t. * include/ruby/intern.h: change rb_unblock_function_t, rb_unblock_function_t. * file.c, process.c: apply above changes. * thread.c, thread_pthread.ci, thread_win32.ci: ditto. * io.c: support blocking open (2). [ruby-core:13614] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_pthread.ci | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'thread_pthread.ci') diff --git a/thread_pthread.ci b/thread_pthread.ci index 3874a46bd6..6004d4aa35 100644 --- a/thread_pthread.ci +++ b/thread_pthread.ci @@ -346,8 +346,9 @@ native_thread_apply_priority(rb_thread_t *th) } static void -ubf_pthread_cond_signal(rb_thread_t *th, void *ptr) +ubf_pthread_cond_signal(void *ptr) { + rb_thread_t *th = (rb_thread_t *)ptr; thread_debug("ubf_pthread_cond_signal (%p)\n", th); pthread_cond_signal(&th->native_thread_data.sleep_cond); } @@ -363,8 +364,9 @@ ubf_select_each(rb_thread_t *th) } static void -ubf_select(rb_thread_t *th, void *ptr) +ubf_select(void *ptr) { + rb_thread_t *th = (rb_thread_t *)ptr; add_signal_thread_list(th); ubf_select_each(th); } @@ -403,6 +405,8 @@ native_sleep(rb_thread_t *th, struct timeval *tv) } else { th->unblock_function = ubf_pthread_cond_signal; + th->unblock_function_arg = th; + if (tv == 0) { thread_debug("native_sleep: pthread_cond_wait start\n"); pthread_cond_wait(&th->native_thread_data.sleep_cond, @@ -418,6 +422,7 @@ native_sleep(rb_thread_t *th, struct timeval *tv) thread_debug("native_sleep: pthread_cond_timedwait end (%d)\n", r); } th->unblock_function = 0; + th->unblock_function_arg = 0; } pthread_mutex_unlock(&th->interrupt_lock); -- cgit v1.2.3