mirror of
https://github.com/fluencelabs/musl
synced 2025-06-27 21:52:02 +00:00
ensure in fork that child gets its own new robust mutex list
This commit is contained in:
@ -11,6 +11,7 @@ pid_t fork(void)
|
|||||||
if (libc.main_thread && !ret) {
|
if (libc.main_thread && !ret) {
|
||||||
pthread_t self = __pthread_self();
|
pthread_t self = __pthread_self();
|
||||||
self->tid = self->pid = syscall(SYS_getpid);
|
self->tid = self->pid = syscall(SYS_getpid);
|
||||||
|
memset(&self->robust_list, 0, sizeof self->robust_list);
|
||||||
libc.threads_minus_1 = 0;
|
libc.threads_minus_1 = 0;
|
||||||
libc.main_thread = self;
|
libc.main_thread = self;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user