ruby-changes:9437
From: nobu <ko1@a...>
Date: Thu, 25 Dec 2008 01:49:17 +0900 (JST)
Subject: [ruby-changes:9437] Ruby:r20975 (mvm): * thread.c (Init_Thread): separated per-process initialization
nobu 2008-12-25 01:48:57 +0900 (Thu, 25 Dec 2008) New Revision: 20975 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20975 Log: * thread.c (Init_Thread): separated per-process initialization from InitVM_Thread. * thread_{pthread,win32}.c (Init_native_thread): ditto. Modified files: branches/mvm/ChangeLog branches/mvm/thread.c branches/mvm/thread_pthread.c branches/mvm/thread_win32.c branches/mvm/version.h Index: mvm/thread_win32.c =================================================================== --- mvm/thread_win32.c (revision 20974) +++ mvm/thread_win32.c (revision 20975) @@ -53,9 +53,14 @@ static void Init_native_thread(void) { + ruby_native_thread_key = TlsAlloc(); +} + +static void +InitVM_native_thread(void) +{ rb_thread_t *th = GET_THREAD(); - ruby_native_thread_key = TlsAlloc(); DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), Index: mvm/ChangeLog =================================================================== --- mvm/ChangeLog (revision 20974) +++ mvm/ChangeLog (revision 20975) @@ -1,3 +1,10 @@ +Thu Dec 25 01:48:53 2008 Nobuyoshi Nakada <nobu@r...> + + * thread.c (Init_Thread): separated per-process initialization + from InitVM_Thread. + + * thread_{pthread,win32}.c (Init_native_thread): ditto. + Wed Dec 17 18:00:15 2008 Nobuyoshi Nakada <nobu@r...> * inits.c (rb_vm_call_inits): no longer passes current vm. Index: mvm/thread_pthread.c =================================================================== --- mvm/thread_pthread.c (revision 20974) +++ mvm/thread_pthread.c (revision 20975) @@ -178,19 +178,17 @@ } static void -init_once_native_thread(void) +Init_native_thread(void) { pthread_key_create(&ruby_native_thread_key, NULL); posix_signal(SIGVTALRM, null_func); } static void -Init_native_thread(void) +InitVM_native_thread(void) { rb_thread_t *th = GET_THREAD(); - static pthread_once_t init_for_all_thread = PTHREAD_ONCE_INIT; - pthread_once(&init_for_all_thread, init_once_native_thread); th->thread_id = pthread_self(); native_cond_initialize(&th->native_thread_data.sleep_cond); ruby_thread_set_native(th); Index: mvm/thread.c =================================================================== --- mvm/thread.c (revision 20974) +++ mvm/thread.c (revision 20975) @@ -3724,6 +3724,9 @@ #define rb_intern(str) rb_intern_const(str) recursive_key = rb_intern("__recursive_key__"); + + /* init thread core */ + Init_native_thread(); } void @@ -3804,7 +3807,7 @@ rb_define_method(rb_cThread, "add_trace_func", thread_add_trace_func_m, 1); /* init thread core */ - Init_native_thread(); + InitVM_native_thread(); { /* main thread setting */ { Index: mvm/version.h =================================================================== --- mvm/version.h (revision 20974) +++ mvm/version.h (revision 20975) @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.1" -#define RUBY_RELEASE_DATE "2008-12-17" +#define RUBY_RELEASE_DATE "2008-12-25" #define RUBY_VERSION_CODE 191 -#define RUBY_RELEASE_CODE 20081217 +#define RUBY_RELEASE_CODE 20081225 #define RUBY_PATCHLEVEL 5000 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 1 #define RUBY_RELEASE_YEAR 2008 #define RUBY_RELEASE_MONTH 12 -#define RUBY_RELEASE_DAY 17 +#define RUBY_RELEASE_DAY 25 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/