-
Notifications
You must be signed in to change notification settings - Fork 787
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix unchecked_map destructor. #3723
Fix unchecked_map destructor. #3723
Conversation
In practice I doubt this can actually bite us, but yeah, the proper way of announcing changes via CVs is under the mutex indeed, even if the change is atomic like this one. Just curious, have you seen this cause issues? |
@theohax In practice, it would bite us on node shutdown, the node could deadlock on shutdown. |
If the working thread is between these two lines when stopped is set to true and the condition variable in notified, it will neither detect the stopped flag nor detect the condition variable notification.
|
0a367c3
to
fe9e60d
Compare
…ariable signal can be missed since the object mutex isn't acquired while setting stopped=true. Converts unchecked_map::stopped to a non-atomic bool since it needs a mutex anyway.
fe9e60d
to
d0089a3
Compare
Fix an issue with unchecked_map::~unchecked_map where the condition variable signal can be missed since the object mutex isn't acquired while setting stopped=true.