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.
This commit is contained in:
Rich Felker
2015-02-16 22:25:50 -05:00
parent fd850de752
commit 36d8e97223
2 changed files with 2 additions and 3 deletions

View File

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

View File

@ -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) {