[PATCH] nptl: Provide a way to block all signals for the timer helper thread

Florian Weimer fweimer@redhat.com
Thu May 14 18:30:15 GMT 2020


* Carlos O'Donell:

> On 5/12/20 3:17 PM, Florian Weimer wrote:
>> * Carlos O'Donell:
>> 
>>>> +/* Exactly like pthread_create if NEW_SIGMASK == NULL.  Otherwise, do
>>>> +   not use the current signal mask for the new thread, but set it to
>>>> +   *NEW_SIGMASK instead (without unblocking internal signals).  */
>
>
> Suggest:
>
> /* Exactly like pthread_create if NEW_SIGMASK is NULL.
>    Create the new thread using the thread descriptor at NEWTHREAD,
>    and the thread attributes from *ATTR, executing provided START_ROUTINE
>    with a single void argument ARG.  The last argument is not present in
>    the public API for pthread_create, but is part of the internal glibc API.
>    The last argument is the signal mask to be restored in the new thread,
>    and is normally NULL, in which case the parent's signal mask is restored
>    as mandated by the standard's requirement for pthread_create.  In some cases
>    though you may wish to keep certain signals blocked to avoid race cases,
>    and today this includes the helper thread created by SIGEV_THREAD where all
>    signals are blocked except SIGCANCEL.  Thus the new_sigmask argument is
>    primarily intended for the creation of helper threads not user threads.  */

Does this mean you think this interface is more generally useful?

I'm still trying to make sense of this request.

Thanks,
Florian



More information about the Libc-alpha mailing list