ruby-changes:17942
From: nobu <ko1@a...>
Date: Sun, 28 Nov 2010 14:48:39 +0900 (JST)
Subject: [ruby-changes:17942] Ruby:r29958 (trunk): * thread_pthread.c (gvl_release, gvl_init): suppress warnings.
nobu 2010-11-28 14:48:31 +0900 (Sun, 28 Nov 2010) New Revision: 29958 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29958 Log: * thread_pthread.c (gvl_release, gvl_init): suppress warnings. * vm_core.h (rb_vm_gvl_destroy): add prototype. Modified files: trunk/ChangeLog trunk/thread_pthread.c trunk/vm_core.h Index: ChangeLog =================================================================== --- ChangeLog (revision 29957) +++ ChangeLog (revision 29958) @@ -1,3 +1,9 @@ +Sun Nov 28 14:48:24 2010 Nobuyoshi Nakada <nobu@r...> + + * 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@r...> * thread_pthread.c (gvl_reinit): register atfork hander only in @@ -15,7 +21,7 @@ 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. Index: thread_pthread.c =================================================================== --- thread_pthread.c (revision 29957) +++ thread_pthread.c (revision 29958) @@ -29,7 +29,7 @@ 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 @@ } } +#if !GVL_SIMPLE_LOCK static void gvl_waiting_push(rb_vm_t *vm, rb_thread_t *th) { @@ -73,6 +74,7 @@ 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 @@ 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; Index: vm_core.h =================================================================== --- vm_core.h (revision 29957) +++ vm_core.h (revision 29958) @@ -639,6 +639,7 @@ 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/