ruby-changes:14238
From: nobu <ko1@a...>
Date: Thu, 10 Dec 2009 15:49:35 +0900 (JST)
Subject: [ruby-changes:14238] Ruby:r26061 (trunk): * thread_pthread.c (native_mutex_reinitialize_atfork): release and
nobu 2009-12-10 15:49:15 +0900 (Thu, 10 Dec 2009) New Revision: 26061 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26061 Log: * thread_pthread.c (native_mutex_reinitialize_atfork): release and re-acquire the lock at re-initialization. Modified files: trunk/ChangeLog trunk/bootstraptest/test_thread.rb trunk/thread_pthread.c Index: ChangeLog =================================================================== --- ChangeLog (revision 26060) +++ ChangeLog (revision 26061) @@ -1,3 +1,8 @@ +Thu Dec 10 15:49:13 2009 Nobuyoshi Nakada <nobu@r...> + + * thread_pthread.c (native_mutex_reinitialize_atfork): release and + re-acquire the lock at re-initialization. + Thu Dec 10 12:56:02 2009 NARUSE, Yui <naruse@r...> * encoding.c (enc_replicate): add Encoding#replicate(name). Index: thread_pthread.c =================================================================== --- thread_pthread.c (revision 26060) +++ thread_pthread.c (revision 26061) @@ -71,7 +71,10 @@ } } -#define native_mutex_reinitialize_atfork(lock) native_mutex_initialize(lock) +#define native_mutex_reinitialize_atfork(lock) (\ + native_mutex_unlock(lock), \ + native_mutex_initialize(lock), \ + native_mutex_lock(lock)) static void native_mutex_destroy(pthread_mutex_t *lock) Index: bootstraptest/test_thread.rb =================================================================== --- bootstraptest/test_thread.rb (revision 26060) +++ bootstraptest/test_thread.rb (revision 26061) @@ -434,4 +434,8 @@ Process.waitpid(pid) rescue NotImplementedError end -}, '[ruby-core:26361]' +}, '[ruby-core:23572]' + +assert_equal 'ok', %q{ + Process.waitpid2(fork {sleep 1})[1].success? ? 'ok' : 'ng' +} -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/