diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | thread_pthread.c | 6 | ||||
-rw-r--r-- | vm_core.h | 1 |
3 files changed, 12 insertions, 3 deletions
@@ -1,3 +1,9 @@ +Sun Nov 28 14:48:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * thread_pthread.c (gvl_release, gvl_init): suppress warnings. + + * vm_core.h (rb_vm_gvl_destroy): add prototype. + Sun Nov 28 14:46:24 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> * thread_pthread.c (gvl_reinit): register atfork hander only in @@ -15,7 +21,7 @@ Sun Nov 28 12:23:57 2010 Koichi Sasada <ko1@atdot.net> this causes some issues such as priority inversion and so on.) This impl. prevents spin-loop (*1) caused on SMP environemnts. *1: Only one Ruby thread acqures GVL again and again. - Bug #2359 [ruby-core:26694] + Bug #2359 [ruby-core:26694] * thread_win32.c, thread_win32.h: Using simple lock not by CRITICAL_SECTION but by Mutex. diff --git a/thread_pthread.c b/thread_pthread.c index 9966943f8e..8a10d3a217 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -29,7 +29,7 @@ static void native_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex); static void native_cond_initialize(pthread_cond_t *cond); static void native_cond_destroy(pthread_cond_t *cond); -static void native_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void)); +static void native_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void)); #define native_mutex_reinitialize_atfork(lock) (\ native_mutex_unlock(lock), \ @@ -50,6 +50,7 @@ gvl_show_waiting_threads(rb_vm_t *vm) } } +#if !GVL_SIMPLE_LOCK static void gvl_waiting_push(rb_vm_t *vm, rb_thread_t *th) { @@ -73,6 +74,7 @@ gvl_waiting_shift(rb_vm_t *vm, rb_thread_t *th) vm->gvl.waiting_threads = vm->gvl.waiting_threads->native_thread_data.gvl_next; vm->gvl.waiting--; } +#endif static void gvl_acquire(rb_vm_t *vm, rb_thread_t *th) @@ -114,7 +116,7 @@ gvl_release(rb_vm_t *vm) native_cond_signal(&th->native_thread_data.gvl_cond); } else { - if (GVL_DEBUG) fprintf(stderr, "gvl release (%p): wakeup: %p\n", GET_THREAD(), 0); + if (GVL_DEBUG) fprintf(stderr, "gvl release (%p): wakeup: %p\n", GET_THREAD(), NULL); /* do nothing */ } vm->gvl.acquired = 0; @@ -639,6 +639,7 @@ VALUE rb_vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, VALUE self, int argc, const VALUE *argv, const rb_block_t *blockptr); VALUE rb_vm_make_proc(rb_thread_t *th, const rb_block_t *block, VALUE klass); VALUE rb_vm_make_env_object(rb_thread_t *th, rb_control_frame_t *cfp); +void rb_vm_gvl_destroy(rb_vm_t *vm); void rb_thread_start_timer_thread(void); void rb_thread_stop_timer_thread(void); |