Opened 11 years ago
Closed 10 years ago
#6266 closed Feature Requests (fixed)
c++11 compliance: thread destructor should call terminate if joinable
Reported by: | viboes | Owned by: | viboes |
---|---|---|---|
Milestone: | Boost 1.50.0 | Component: | thread |
Version: | Boost 1.48.0 | Severity: | Problem |
Keywords: | c++11 compliance thread dtor V2 | Cc: |
Description
In order to be standard compliant the thread destructor should call terminate if joinable instead of detaching the thread.
"30.3.1.3 thread destructor [thread.thread.destr]
~thread();
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.
Attachments (1)
Change History (5)
comment:1 by , 11 years ago
Summary: | c++11 complicance: thread destructor should call terminate if joinable → c++11 compliance: thread destructor should call terminate if joinable |
---|
comment:2 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 11 years ago
Attachment: | 6266.patch added |
---|
comment:3 by , 11 years ago
Milestone: | To Be Determined → Boost 1.50.0 |
---|
comment:4 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Committed in release branch at [78543]
The previous patch contains the modifications for #6269 also.
Committed revision [77718].