Explorar o código

apply vmlock wait to __unmapself in pthread_exit

Rich Felker %!s(int64=10) %!d(string=hai) anos
pai
achega
a2d3053354
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/thread/pthread_create.c

+ 4 - 0
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);