summaryrefslogtreecommitdiff
path: root/src/process
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015-04-10 00:54:48 -0400
committerRich Felker <dalias@aerifal.cx>2015-04-10 00:54:48 -0400
commit4e98cce1c529a304d7b55b5455078b9532f93e9b (patch)
treea824ce64116146e20de6264fe4e91405fd1a2124 /src/process
parent12e1e324683a1d381b7f15dd36c99b37dd44d940 (diff)
downloadmusl-4e98cce1c529a304d7b55b5455078b9532f93e9b.tar.gz
musl-4e98cce1c529a304d7b55b5455078b9532f93e9b.tar.bz2
musl-4e98cce1c529a304d7b55b5455078b9532f93e9b.tar.xz
musl-4e98cce1c529a304d7b55b5455078b9532f93e9b.zip
optimize out setting up robust list with kernel when not needed
as a result of commit 12e1e324683a1d381b7f15dd36c99b37dd44d940, kernel processing of the robust list is only needed for process-shared mutexes. previously the first attempt to lock any owner-tracked mutex resulted in robust list initialization and a set_robust_list syscall. this is no longer necessary, and since the kernel's record of the robust list must now be cleared at thread exit time for detached threads, optimizing it out is more worthwhile than before too.
Diffstat (limited to 'src/process')
-rw-r--r--src/process/fork.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/process/fork.c b/src/process/fork.c
index 43c52bc4..8d676828 100644
--- a/src/process/fork.c
+++ b/src/process/fork.c
@@ -25,7 +25,8 @@ pid_t fork(void)
if (libc.has_thread_pointer && !ret) {
pthread_t self = __pthread_self();
self->tid = __syscall(SYS_gettid);
- memset(&self->robust_list, 0, sizeof self->robust_list);
+ self->robust_list.off = 0;
+ self->robust_list.pending = 0;
libc.threads_minus_1 = 0;
}
__restore_sigs(&set);