You need to sign in or sign up before continuing.
提交 8ed2bd8b 编写于 作者: R Rich Felker

clear need_locks in child after fork

the child is single-threaded, but may still need to synchronize with
last changes made to memory by another thread in the parent, so set
need_locks to -1 whereby the next lock-taker will drop to 0 and
prevent further barriers/locking.
上级 fca7428c
......@@ -30,6 +30,7 @@ pid_t fork(void)
self->next = self->prev = self;
__thread_list_lock = 0;
libc.threads_minus_1 = 0;
if (libc.need_locks) libc.need_locks = -1;
}
__restore_sigs(&set);
__fork_handler(!ret);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册