浏览代码

ensure in fork that child gets its own new robust mutex list

Rich Felker 14 年之前
父节点
当前提交
4ec07e1f60
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/process/fork.c

+ 1 - 0
src/process/fork.c

@@ -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);
+		memset(&self->robust_list, 0, sizeof self->robust_list);
 		libc.threads_minus_1 = 0;
 		libc.main_thread = self;
 	}