[PATCH 3/6] nptl: Make pthread_kill async-signal-safe
Adhemerval Zanella
adhemerval.zanella@linaro.org
Fri Dec 4 18:26:27 GMT 2020
On 04/12/2020 15:20, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
>
>> Simiar to raise (BZ #15368), pthread_kill is also defined as
>> async-signal-safe (POSIX.1-2008 TC1). However, similar to raise
>> it has the same issues relating to signal handling.
>>
>> Different than raise, all the signal are blocked so it would be
>> possible to implement pthread_cancel (which also should be
>> async-cancel safe).
>
> What do you mean by implementing pthread_cancel?
>
> Patch looks okay as far as I can see, but we'll eventually need a
> different approach to deal with the TID reuse race.
>
For TID reuse case I don't see a easy way other than add a lock
on pthread_kill with synchronizes with pthread_exit. It would
require some changes on how we synchronize the TID clear by the
kernel.
More information about the Libc-alpha
mailing list