-
Notifications
You must be signed in to change notification settings - Fork 36.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure we re-acquire lock if a task throws #6565
Conversation
utACK. |
Couldn't this be done using a scope bound, RAII locking mechanism instead? utACK |
@dcousens: Oh, hey, it looks like there actually is a reverse lock: http://www.boost.org/doc/libs/1_55_0/doc/html/thread/synchronization.html#thread.synchronization.other_locks.reverse_lock I'll reimplement tomorrow, should be much cleaner. |
I like the reverse lock approach :)
|
Re-wrote it with a reverse_lock, it's much nicer now |
utACK
|
utACK, good find @casey |
/me really likes this solution. An inverse lock :-) |
fb08d92 Make sure we re-acquire lock if a task throws (Casey Rodarmor)
boost::reverse_lock is new as of 1.50 :( We either need to set that as the minimum version required or work out a different fix here. |
The reverse lock implementation is very simple. If we can't bump the minimum required boost version to 1.50, I could copy pasta it in. Alternatively we could just go back to the first implementation, which, although ugly, works fine. |
I see no reason why we wouldn't be able to bump? |
Debian wheezy is 1.49 please do not bump the required version. |
Also ran into the same problem like @pstratem. I solved it with a dist upgrade to jessie... which is somehow not ideal. Support for boost 1.49 would be good but not urgently necessary. |
Boost 1.49 was released on February 24th, 2012. Why the lag on a 4-month older package? |
Opened PR #6608, to revert and fix without a boost dependency. |
This fixes #6394
Pretty simple, it just makes sure to re-acquire the lock in case f throws, so that we don't touch nThreadsServicingQueue without the lock. The empty throw statement re-raises the current exception.