Ticket #6266 (closed Feature Requests: fixed)
c++11 compliance: thread destructor should call terminate if joinable
|Reported by:||viboes||Owned by:||viboes|
|Keywords:||c++11 compliance thread dtor V2||Cc:|
In order to be standard compliant the thread destructor should call terminate if joinable instead of detaching the thread.
"188.8.131.52 thread destructor [thread.thread.destr]
If joinable() then terminate(), otherwise no effects. [Note: Either implicitly detaching or joining a joinable() thread in its destructor could result in difficult to debug correctness (for detach) or performance (for join) bugs encountered only when an exception is raised. Thus the programmer must ensure that the destructor is never executed while the thread is still joinable. — end note ]"
This behavior is incompatible with the current version, so it shall be activated by a specific define, i.e., BOOST_THREAD_VERSION=2.
- Summary changed from c++11 complicance: thread destructor should call terminate if joinable to c++11 compliance: thread destructor should call terminate if joinable
- Owner changed from anthonyw to viboes
- Status changed from new to assigned