-
Notifications
You must be signed in to change notification settings - Fork 592
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
Replace IceUtil::Mutex with std::mutex #1755
Conversation
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.
Looks good.
#include <Ice/UserExceptionFactory.h> | ||
#include <Ice/ValueFactory.h> | ||
|
||
#include <mutex> |
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.
We should have blank line between include and namespace.
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.
Looks good! See comments.
cpp/src/Ice/ConnectionI.cpp
Outdated
{ | ||
wait(); | ||
} | ||
_conditionVariable.wait(lock, [this]{ return _state >= StateNotValidated; }); |
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 the equality check correct?
_conditionVariable.wait(lock, [this]{ return _state >= StateNotValidated; }); | |
_conditionVariable.wait(lock, [this]{ return _state > StateNotValidated; }); |
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.
Good catch!
cpp/src/IceBT/Engine.cpp
Outdated
@@ -1256,7 +1256,7 @@ class BluetoothService : public DBus::Filter, public std::enable_shared_from_thi | |||
ConnectCallbackPtr _cb; | |||
}; | |||
|
|||
IceUtil::Monitor<IceUtil::Mutex> _lock; | |||
std::mutex _lock; |
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.
Can we rename this to _mutex
?
Actually staring at the code, you're locking _mutex
which used to be _lock
. A bug? Am I missing something?
This is a first pass on replacing IceUtil::Mutex by std::mutex