[PATCH] nptl: Fix join/tryjoin comments.
Florian Weimer
fweimer@redhat.com
Mon Feb 11 21:37:00 GMT 2019
* Carlos O'Donell:
> This commit fixes several inaccurate comments in the implementation of
> __pthread_timedjoin_ex(), pthread_tryjoin_np, and lll_wait_tid, all of
> which are used to implement POSIX thread joining.
GNU style is not to use () after function names.
> Firstly, in pthread_tryjoin_np() we only attempt the join if a read of
> pd->tid == 0, because that means the thread has already been reaped by
> the kernel and we can safely join it without blocking.
>
> Secondly, all join implementations call the common
> __pthread_timedjoin_ex and only if abstime is NULL (block) do we
> actually need to use cancellation (to cancel the potentially infinite
> wait).
I think the change regarding abstime == NULL is wrong. This is about
pthread_join/pthread_timedjoin_np (blocking) on the one hand and
pthread_tryjoin_np on the other (not blocking).
Thanks,
Florian
More information about the Libc-alpha
mailing list