-
Notifications
You must be signed in to change notification settings - Fork 83
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
Fix condition variable wait #436
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,444 @@ | |||
// based on the <boost/thread/win32/condition_variable.hpp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the file's version of Boost in this comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pushed in
void lock() | ||
{ | ||
if (_unlocked) | ||
{ | ||
_lock.lock(); | ||
_unlocked = false; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any possibility of lock()
throwing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is by design. The caller of the wait
call can catch the throw and re-wait again.
Co-authored-by: jonathan-r-thorpe <[email protected]>
Co-authored-by: jonathan-r-thorpe <[email protected]>
Windows
boost::condition_variable_any::wait
would throw nested lock exceptions whenboost::shared_mutex
has reached themaximum number of exclusive_waiting locks. This problem occurs inside the
boost::basic_condition_variable::do_wait_until
when
relocker
is out of scope. This could cause program termination due to unhandled exceptions.@garethsb reports this problem in #315.