[PATCH] nptl: Use SA_RESTART for SIGCANCEL handler
Florian Weimer
fweimer@redhat.com
Tue Jun 22 18:33:23 GMT 2021
* Adhemerval Zanella:
> On 18/06/2021 08:38, Florian Weimer wrote:
>> * Adhemerval Zanella via Libc-alpha:
>>
>>> The usage of signals to implementation pthread cancellation is an
>>> implementation detail and should not be visible through cancellation
>>> entrypoints.
>>>
>>> However now that pthread_cancel always send the SIGCANCEL, some
>>> entrypoint might be interruptable and return EINTR to the caller
>>> (for instance on sem_wait).
>>>
>>> Using SA_RESTART hides this, since the cancellation handler should
>>> either act uppon cancellation (if asynchronous cancellation is enable)
>>> or ignore the cancellation internal signal.
>>
>> I think this still needs a NEWS entry because there have been kernel
>> bugs in this area (e.g. in CIFS).
>
> Ok, I have added the following on "Deprecated and removed features, and
> other changes affecting compatibility"
>
> * The pthread cancellation handler is now setup with SA_RESTART. It should
> not be visible to application since the cancellation handler should either
> act uppon cancellation (if asynchronous cancellation is enabled) or
> ignore the cancellation internal signal.
The key change is: The cancellation signal is now sent in more cases,
but this should be transparent to the application due to SA_RESTART.
Thanks,
Florian
More information about the Libc-alpha
mailing list