|Anonymous | Login||2018-12-12 11:49 UTC|
|Main | My View | View Issues | Change Log | Docs|
|Viewing Issue Simple Details|
|ID||Category||Severity||Type||Date Submitted||Last Update|
|0001167||[1003.1(2016)/Issue7+TC2] System Interfaces||Editorial||Clarification Requested||2017-10-30 16:33||2017-10-30 16:47|
|Reporter||Florian Weimer||View Status||public|
|User Reference||https://sourceware.org/bugzilla/show_bug.cgi?id=22337 [^]|
|Final Accepted Text|
|Summary||0001167: Does pthread_detach make a thread non-joinable?|
The description of pthread_detach is carefully worded in such a way that it does not mention whether the thread ceases to be joinable/is in a detached state after the call to the function. It is unclear what the intent is. Based on a strict reading of specification, the only way to create a non-joinable thread is the detachstate thread attribute specified at thread creation.
There are two choices here: Mention that pthread_detach makes the thread non-joinable, or explicitly say that pthread_detach does not alter the joinable state of the thread (so that pthread_join is permitted if the lifetime of the thread has not ended yet).
|Desired Action||The GNU C Library favors that pthread_detach makes the thread non-joinable because this is what the current implementation does.|
|Tags||No tags attached.|
Hmm, XSH 2.9.2 "Thread IDs" ends with this sentence:
If a thread is detached, its thread ID is invalid for use as an
argument in a call to pthread_detach()or pthread_join().
Does that cover this?
Florian Weimer (reporter)
It is unclear if XSH 2.9.2 “detached” here refers to the detachstate, or the action of pthread_detach.
The behavior of pthread_detach is specified as:
“The pthread_detach() function shall indicate to the implementation that storage for the thread thread can be reclaimed when that thread terminates.”
So it is specifically not phrased in terms of detached/joinable threads.
|2017-10-30 16:33||Florian Weimer||New Issue|
|2017-10-30 16:33||Florian Weimer||Name||=> Florian Weimer|
|2017-10-30 16:33||Florian Weimer||Organization||=> Red Hat|
|2017-10-30 16:33||Florian Weimer||User Reference||=> https://sourceware.org/bugzilla/show_bug.cgi?id=22337 [^]|
|2017-10-30 16:33||Florian Weimer||Section||=> pthread_detach|
|2017-10-30 16:33||Florian Weimer||Page Number||=> unknown|
|2017-10-30 16:33||Florian Weimer||Line Number||=> unknown|
|2017-10-30 16:34||Florian Weimer||Issue Monitored: Florian Weimer|
|2017-10-30 16:40||philip-guenther||Note Added: 0003875|
|2017-10-30 16:47||Florian Weimer||Note Added: 0003876|
|Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group|