about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2015-04-10 03:47:42 -0400
committerRich Felker <dalias@aerifal.cx>2015-04-10 03:47:42 -0400
commita2d3053354432f3e3b5a787c1527d4b414e9acb0 (patch)
tree372876e526e95a0f682264fc4cc8909e0951d835 /src
parentf08ab9e61a147630497198fe3239149275c0a3f4 (diff)
downloadmusl-a2d3053354432f3e3b5a787c1527d4b414e9acb0.tar.gz
musl-a2d3053354432f3e3b5a787c1527d4b414e9acb0.tar.xz
musl-a2d3053354432f3e3b5a787c1527d4b414e9acb0.zip
apply vmlock wait to __unmapself in pthread_exit
Diffstat (limited to 'src')
-rw-r--r--src/thread/pthread_create.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c
index 08c5f4f8..33808ce5 100644
--- a/src/thread/pthread_create.c
+++ b/src/thread/pthread_create.c
@@ -108,6 +108,10 @@ _Noreturn void __pthread_exit(void *result)
 		if (self->robust_list.off)
 			__syscall(SYS_set_robust_list, 0, 3*sizeof(long));
 
+		/* Since __unmapself bypasses the normal munmap code path,
+		 * explicitly wait for vmlock holders first. */
+		__vm_wait();
+
 		/* The following call unmaps the thread's stack mapping
 		 * and then exits without touching the stack. */
 		__unmapself(self->map_base, self->map_size);