This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] nptl: Reinstate pthread_timedjoin_np as a cancellation point (BZ#24215)



On 13/02/2019 12:09, Carlos O'Donell wrote:
> On 2/12/19 3:18 PM, Adhemerval Zanella wrote:
>> Patch ce7eb0e90315 ("nptl: Cleanup cancellation macros") changed the
>> join sequence for internal common __pthread_timedjoin_ex to use the
>> new macro lll_wait_tid.  The idea was this macro would issue the
>> cancellable futex operation depending whether the timeout is used or
>> not.  However if a timeout is used, __lll_timedwait_tid is called and
>> it is not a cancellable entrypoint.
> 
> Thanks for following up on this.
> 
> OK for master with additional comment below (see Fix:).
> 
> Once you commit I'll clean up the straggling comments that I fixed
> before (pthread_tryjoin.c still has a wrong comment).

Thanks for the review, I added the change locally:

diff --git a/nptl/pthread_join_common.c b/nptl/pthread_join_common.c
index 3f9cf1674b..f719613268 100644
--- a/nptl/pthread_join_common.c
+++ b/nptl/pthread_join_common.c
@@ -120,6 +120,10 @@ __pthread_timedjoin_ex (pthread_t threadid, void **thread_return,
     /* There is already somebody waiting for the thread.  */
     return EINVAL;
 
+  /* BLOCK waits either indefinitely or based on an absolute time.  POSIX also
+     states a cancellation points shall occur for pthread_join, and we use the
+     same rationale for posix_timedjoin_np.  Both timedwait_tid and the futex
+     call use the cancellable variant.  */
   if (block)
     {
       /* During the wait we change to asynchronous cancellation.  If we


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]