We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://github.com/boostorg/asio/blob/46ed570aa36d1a665b0425e26d013e189b26515b/include/boost/asio/detail/conditionally_enabled_mutex.hpp#LL79-L87C6
// Explicitly release the lock. void unlock() { if (locked_) { mutex_.unlock(); locked_ = false; } }
Hello, I'm reviewing a package with Coverity and it points out that this locked_ = false; happens after the mutex is unlocked.
locked_ = false;
Is there something to prevent one thread calling lock(), another thread calling unlock(), and the order of operations going like this:
lock()
unlock()
mutex_.unlock(); mutex_.lock(); locked_ = true; locked_ = false;
Thanks
The text was updated successfully, but these errors were encountered:
No branches or pull requests
https://github.com/boostorg/asio/blob/46ed570aa36d1a665b0425e26d013e189b26515b/include/boost/asio/detail/conditionally_enabled_mutex.hpp#LL79-L87C6
Hello, I'm reviewing a package with Coverity and it points out that this
locked_ = false;
happens after the mutex is unlocked.Is there something to prevent one thread calling
lock()
, another thread callingunlock()
, and the order of operations going like this:Thanks
The text was updated successfully, but these errors were encountered: