This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/50862] deadlock in std::condition_variable_any
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 26 Oct 2011 13:05:52 +0000
- Subject: [Bug libstdc++/50862] deadlock in std::condition_variable_any
- Auto-submitted: auto-generated
- References: <bug-50862-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862
--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-10-26 13:05:52 UTC ---
(In reply to comment #11)
> unique_lock<mutex> __my_lock(_M_mutex);
> _Unlock __unlock(__lock);
> unique_lock<mutex> __my_lock2(std::move(__my_lock));
> _M_cond.wait(__my_lock2);
> __unlock.release().lock(); // if no exception so far - may throw here
This re-locks it while _M_mutex is locked, reintroducing the deadlock