Title
Various threading bugs #13
Status
c++11
Section
[thread.thread.member]
Submitter
Pete Becker

Created on 2009-01-07.00:00:00 last changed 162 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

In [thread.thread.member] change:

void detach();

...

-14- Error conditions:

  • no_such_process -- if the thread is not a valid thread.
  • invalid_argument -- if the thread is not a detachable joinable thread.
Date: 2010-10-21.18:28:33

[ 2009-10 Santa Cruz: ]

Mark as Ready with proposed resolution from Summit.

Date: 2010-10-21.18:28:33

[ Post Summit, Anthony Williams adds: ]

This is covered by the precondition that joinable() be true.

Anthony recommends this proposed wording:

In [thread.thread.member] change:

void detach();

...

-14- Error conditions:

  • ...
  • invalid_argument -- not a detachable thread.
Date: 2010-10-21.18:28:33

[ Post Summit, Jonathan Wakely adds: ]

A thread is detachable if it is joinable. As we've defined joinable, we can just use that.

This corresponds to the pthreads specification, where pthread_detach fails if the thread is not joinable:

EINVAL: The implementation has detected that the value specified by thread does not refer to a joinable thread.

Jonathan recommends this proposed wording:

In [thread.thread.member] change:

void detach();

...

-14- Error conditions:

  • ...
  • invalid_argument -- not a detachable joinable thread.
Date: 2010-10-21.18:28:33

[ Summit, proposed resolution: ]

In [thread.thread.member] change:

void detach();

...

-14- Error conditions:

  • no_such_process -- if the thread is not a valid thread.
  • invalid_argument -- if the thread is not a detachable joinable thread.
Date: 2010-10-21.18:28:33

[ Howard adds: ]

Due to a mistake on my part, 3 proposed resolutions appeared at approximately the same time. They are all three noted below in the discussion.

Date: 2009-01-07.00:00:00

[thread.thread.member]: thread::detach is required to throw an exception if the thread is "not a detachable thread". "Detachable" is never defined.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg4590
2010-10-21 18:28:33adminsetmessages: + msg4589
2010-10-21 18:28:33adminsetmessages: + msg4588
2010-10-21 18:28:33adminsetmessages: + msg4587
2010-10-21 18:28:33adminsetmessages: + msg4586
2010-10-21 18:28:33adminsetmessages: + msg4585
2009-01-07 00:00:00admincreate