[Bug nptl/12889] Race condition in pthread_kill

fweimer at redhat dot com sourceware-bugzilla@sourceware.org
Sat Oct 31 12:08:00 GMT 2015


https://sourceware.org/bugzilla/show_bug.cgi?id=12889

--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
POSIX says:

“The lifetime of a thread ID ends after the thread terminates if it was created
with the detachstate attribute set to PTHREAD_CREATE_DETACHED or if
pthread_detach() or pthread_join() has been called for that thread.”

How is this to be interpreted?  This way?

  TERMINATED && (CREATED-AS-DETACHED || DETACH-CALLED || JOIN-CALLED)

Or this way?

  (TERMINATED && CREATED-AS-DETACHED) || DETACH-CALLED || JOIN-CALLED

In the second case, pthread_detach and pthread_join could just clear the TID in
the thread descriptor to avoid the race, before reaping the TID from the
kernel.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list