Title
unique_lock::lock and resource_deadlock_would_occur
Status
dup
Section
[thread.lock.unique.locking]
Submitter
Jeffrey Yasskin

Created on 2009-09-30.00:00:00 last changed 171 months ago

Messages

Date: 2009-11-14.00:00:00

[ 2009-11-14 Moved to Tentatively Dup after 5 positive votes on c++std-lib. ]

Date: 2009-11-11.00:00:00

[ 2009-11-11 Alisdair notes that this issue is very closely related to 1159, if not a dup. ]

Date: 2009-09-30.00:00:00

Duplicate: 1159

unique_lock::lock and friends raise "resource_deadlock_would_occur -- if the current thread already owns the mutex (i.e., on entry, owns is true)." 1) The current thread owning a mutex is not the same as any particular unique_lock::owns being true. 2) There's no need to raise this exception for a recursive_mutex if owns is false. 3) If owns is true, we need to raise some exception or the unique_lock will lose track of whether to unlock itself on destruction, but "deadlock" isn't it. For (3), s/bool owns/int ownership_level/ would fix it.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg1194
2010-10-21 18:28:33adminsetmessages: + msg1193
2009-09-30 00:00:00admincreate