Преглед на файлове

make pthread_exit responsible for disabling cancellation

this requirement is tucked away in XSH 2.9.5 Thread Cancellation under
the heading Thread Cancellation Cleanup Handlers.
Rich Felker преди 10 години
родител
ревизия
36d8e97223
променени са 2 файла, в които са добавени 2 реда и са изтрити 3 реда
  1. 0 3
      src/thread/pthread_cancel.c
  2. 2 0
      src/thread/pthread_create.c

+ 0 - 3
src/thread/pthread_cancel.c

@@ -3,9 +3,6 @@
 
 void __cancel()
 {
-	pthread_t self = __pthread_self();
-	self->canceldisable = 1;
-	self->cancelasync = 0;
 	pthread_exit(PTHREAD_CANCELED);
 }
 

+ 2 - 0
src/thread/pthread_create.c

@@ -23,6 +23,8 @@ _Noreturn void __pthread_exit(void *result)
 	pthread_t self = __pthread_self();
 	sigset_t set;
 
+	self->canceldisable = 1;
+	self->cancelasync = 0;
 	self->result = result;
 
 	while (self->cancelbuf) {