ruby-changes:42887
From: nobu <ko1@a...>
Date: Mon, 9 May 2016 09:55:25 +0900 (JST)
Subject: [ruby-changes:42887] nobu:r54961 (trunk): thread.c: GET_THREAD once in rb_thread_atfork
nobu 2016-05-09 10:52:01 +0900 (Mon, 09 May 2016) New Revision: 54961 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54961 Log: thread.c: GET_THREAD once in rb_thread_atfork * thread.c (rb_thread_atfork_internal): move th to an argument. * thread.c (rb_thread_atfork): do not repeat GET_THREAD(). Modified files: trunk/ChangeLog trunk/thread.c Index: ChangeLog =================================================================== --- ChangeLog (revision 54960) +++ ChangeLog (revision 54961) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon May 9 10:51:59 2016 Nobuyoshi Nakada <nobu@r...> + + * thread.c (rb_thread_atfork_internal): move th to an argument. + + * thread.c (rb_thread_atfork): do not repeat GET_THREAD(). + Mon May 9 10:46:36 2016 Nobuyoshi Nakada <nobu@r...> * thread.c (rb_thread_atfork, rb_thread_atfork_before_exec): do Index: thread.c =================================================================== --- thread.c (revision 54960) +++ thread.c (revision 54961) @@ -3942,9 +3942,8 @@ clear_coverage(void) https://github.com/ruby/ruby/blob/trunk/thread.c#L3942 } static void -rb_thread_atfork_internal(void (*atfork)(rb_thread_t *, const rb_thread_t *)) +rb_thread_atfork_internal(rb_thread_t *th, void (*atfork)(rb_thread_t *, const rb_thread_t *)) { - rb_thread_t *th = GET_THREAD(); rb_thread_t *i = 0; rb_vm_t *vm = th->vm; vm->main_thread = th; @@ -3973,8 +3972,9 @@ terminate_atfork_i(rb_thread_t *th, cons https://github.com/ruby/ruby/blob/trunk/thread.c#L3972 void rb_thread_atfork(void) { - rb_thread_atfork_internal(terminate_atfork_i); - GET_THREAD()->join_list = NULL; + rb_thread_t *th = GET_THREAD(); + rb_thread_atfork_internal(th, terminate_atfork_i); + th->join_list = NULL; /* We don't want reproduce CVE-2003-0900. */ rb_reset_random_seed(); @@ -3991,7 +3991,8 @@ terminate_atfork_before_exec_i(rb_thread https://github.com/ruby/ruby/blob/trunk/thread.c#L3991 void rb_thread_atfork_before_exec(void) { - rb_thread_atfork_internal(terminate_atfork_before_exec_i); + rb_thread_t *th = GET_THREAD(); + rb_thread_atfork_internal(th, terminate_atfork_before_exec_i); } #else void -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/