The C Standard, 220.127.116.11 [ISO/IEC 9899:2011], states that a thread shall not be joined once it was previously joined or detached. Similarly, subclause 18.104.22.168 states that a thread shall not be detached once it was previously joined or detached. Violating either of these subclauses results in undefined behavior.
Noncompliant Code Example
This noncompliant code example detaches a thread that is later joined.
This compliant solution does not detach the thread. Its resources are released upon successfully joining with the main thread:
Joining or detaching a previously joined or detached thread is undefined behavior.
|Supported, but no explicit checker|
Do not join or detach a thread that was previously joined or detached
Subclause 22.214.171.124, "The