ensure in fork that child gets its own new robust mutex list
authorRich Felker <dalias@aerifal.cx>
Sun, 17 Jul 2011 03:17:17 +0000 (23:17 -0400)
committerRich Felker <dalias@aerifal.cx>
Sun, 17 Jul 2011 03:17:17 +0000 (23:17 -0400)
src/process/fork.c

index a04e892..7530ff9 100644 (file)
@@ -11,6 +11,7 @@ pid_t fork(void)
        if (libc.main_thread && !ret) {
                pthread_t self = __pthread_self();
                self->tid = self->pid = syscall(SYS_getpid);
        if (libc.main_thread && !ret) {
                pthread_t self = __pthread_self();
                self->tid = self->pid = syscall(SYS_getpid);
+               memset(&self->robust_list, 0, sizeof self->robust_list);
                libc.threads_minus_1 = 0;
                libc.main_thread = self;
        }
                libc.threads_minus_1 = 0;
                libc.main_thread = self;
        }