[PATCH v2 02/19] nptl: Set cancellation type and state on pthread_exit

Adhemerval Zanella adhemerval.zanella@linaro.org
Thu Aug 26 11:52:34 GMT 2021



On 26/08/2021 06:38, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> +/* Check if a thread with PTHREAD_CANCEL_ASYNCHRONOUS cancellation on
>> +   blocked read() sets the correct state and type as pthread_exit.  */
>> +static void *
>> +tf_cancel_async (void *arg)
>> +{
>> +  TEST_VERIFY (pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL)
>> +	       == 0);
>> +
>> +  xpthread_barrier_wait (&b);
>> +
>> +  pthread_cleanup_push (clh, NULL);
> 
> This assumes that pthread_cleanup_push is async-cancel-safe.  According
> to this thread:
> 
>   Async cacellation and pthread_cleanup_push
>   <https://sourceware.org/pipermail/libc-alpha/2021-August/129816.html>
> 
> this is not always true.
> 
> Should we build this test with -fno-exceptions?

Or I can't remove the aync test part and only test the deferred part,
I don't have a strong opinion. 

> 
> Rest of the patch looks okay to me.
> 
> Thanks,
> Florian
> 


More information about the Libc-alpha mailing list