[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-12-18 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 Jonathan Wakely changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-12-18 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 --- Comment #18 from Jonathan Wakely 2011-12-19 00:34:33 UTC --- Author: redi Date: Mon Dec 19 00:34:29 2011 New Revision: 182467 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182467 Log: PR libstdc++/50862 * include/std/conditio

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-26 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 --- Comment #17 from Jonathan Wakely 2011-10-26 23:35:30 UTC --- Author: redi Date: Wed Oct 26 23:35:26 2011 New Revision: 180549 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=180549 Log: PR libstdc++/50862 * include/std/conditio

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-26 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 --- Comment #16 from Jonathan Wakely 2011-10-26 14:06:12 UTC --- Yes, thanks for spotting it. Ideally we'd define this_thread::yield() anyway, but until then the test should use the dg-require

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-26 Thread aoliva at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 --- Comment #15 from Alexandre Oliva 2011-10-26 13:55:25 UTC --- Shouldn't the testcase contain: // { dg-require-sched-yield "" } ? I'm getting a failure because this_thread::yield is not defined, and 30_threads/this_thread/2.cc contains this

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-26 Thread bartosz.szurgot at pwr dot wroc.pl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 --- Comment #14 from bartek 'basz' szurgot 2011-10-26 13:42:29 UTC --- uhum - i missed that one... :/ ok then - looks like http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862#c10 is a working solution. :)

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-26 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 --- Comment #13 from Jonathan Wakely 2011-10-26 13:05:52 UTC --- (In reply to comment #11) > unique_lock __my_lock(_M_mutex); > _Unlock __unlock(__lock); > unique_lock __my_lock2(std::move(__my_lock)); > _M_cond.wait(__my_lock2); > __unlock.relea

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-26 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 --- Comment #12 from Jonathan Wakely 2011-10-26 13:02:31 UTC --- (In reply to comment #11) > i'm not sure about uncaught_exception(). i remember reading in Herb Sutter's > that it's usage should be avoided, since it has some flaw, that makes it's

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-26 Thread bartosz.szurgot at pwr dot wroc.pl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 --- Comment #11 from bartek 'basz' szurgot 2011-10-26 12:41:34 UTC --- i'm not sure about uncaught_exception(). i remember reading in Herb Sutter's that it's usage should be avoided, since it has some flaw, that makes it's return value unsure. bu

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-26 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 --- Comment #10 from Jonathan Wakely 2011-10-26 10:29:50 UTC --- Yes, I suppose it should be: ~_Unlock() { if (uncaught_exception()) __try { _M_lock.lock(); } __catch(...) { } else _M_lock.lock(); }

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-25 Thread bartosz.szurgot at pwr dot wroc.pl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 --- Comment #9 from bartek 'basz' szurgot 2011-10-26 06:39:15 UTC --- implementation is nice. i think there is still one more problem to be fixed, though. namely the line: ~_Unlock() { _M_lock.lock(); } since lock() may throw an exception, which

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-25 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 --- Comment #8 from Jonathan Wakely 2011-10-25 22:29:41 UTC --- fixed on trunk so far, I'll wait until 4.6.2 is released then fix it for 4.6.3 too

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-25 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 --- Comment #7 from Jonathan Wakely 2011-10-25 20:56:47 UTC --- Author: redi Date: Tue Oct 25 20:56:43 2011 New Revision: 180446 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=180446 Log: PR libstdc++/50862 * include/std/condition

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-25 Thread bartosz.szurgot at pwr dot wroc.pl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 --- Comment #6 from basz 2011-10-25 14:45:29 UTC --- yes - you're right. i got this note all wrong. thanks for the clarifications and links!

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-25 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 --- Comment #5 from Jonathan Wakely 2011-10-25 14:09:29 UTC --- (In reply to comment #4) > condition_variable_any is a bit more confusing. it says that it must be called > in 30.5.2.10, but 30.5.2.9 say it is undefined, if lock is called or not

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-25 Thread bartosz.szurgot at pwr dot wroc.pl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 --- Comment #4 from basz 2011-10-25 13:51:45 UTC --- the most recent document on C++0x i have is N3290. according to it it is so for condition_variable (30.5.1.9 and 30.5.1.10), but description for wait() of condition_variable_any is a bit more c

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-25 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 Jonathan Wakely changed: What|Removed |Added Target Milestone|--- |4.6.3 --- Comment #3 from Jonathan Wake

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-25 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed|

[Bug libstdc++/50862] deadlock in std::condition_variable_any

2011-10-25 Thread bartosz.szurgot at pwr dot wroc.pl
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50862 --- Comment #1 from basz 2011-10-25 10:28:09 UTC --- Created attachment 25611 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25611 patch fixing the problem unlocking local mutex, before locking back user's lock solves the problem.