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(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a46df859cc
commit
639bfd6d9c
@ -1,3 +1,9 @@
|
|||||||
|
Mon May 9 10:51:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Mon May 9 10:46:36 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* thread.c (rb_thread_atfork, rb_thread_atfork_before_exec): do
|
* thread.c (rb_thread_atfork, rb_thread_atfork_before_exec): do
|
||||||
|
11
thread.c
11
thread.c
@ -3942,9 +3942,8 @@ clear_coverage(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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_thread_t *i = 0;
|
||||||
rb_vm_t *vm = th->vm;
|
rb_vm_t *vm = th->vm;
|
||||||
vm->main_thread = th;
|
vm->main_thread = th;
|
||||||
@ -3973,8 +3972,9 @@ terminate_atfork_i(rb_thread_t *th, const rb_thread_t *current_th)
|
|||||||
void
|
void
|
||||||
rb_thread_atfork(void)
|
rb_thread_atfork(void)
|
||||||
{
|
{
|
||||||
rb_thread_atfork_internal(terminate_atfork_i);
|
rb_thread_t *th = GET_THREAD();
|
||||||
GET_THREAD()->join_list = NULL;
|
rb_thread_atfork_internal(th, terminate_atfork_i);
|
||||||
|
th->join_list = NULL;
|
||||||
|
|
||||||
/* We don't want reproduce CVE-2003-0900. */
|
/* We don't want reproduce CVE-2003-0900. */
|
||||||
rb_reset_random_seed();
|
rb_reset_random_seed();
|
||||||
@ -3991,7 +3991,8 @@ terminate_atfork_before_exec_i(rb_thread_t *th, const rb_thread_t *current_th)
|
|||||||
void
|
void
|
||||||
rb_thread_atfork_before_exec(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
|
#else
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user