thread/Cond: add wait() overload which takes a unique_lock<>
Just like std::condition_variable, which however has no way to specify the std::mutex directly.
This commit is contained in:
@@ -167,7 +167,7 @@ private:
|
||||
}
|
||||
|
||||
void WaitConnected() {
|
||||
const std::lock_guard<Mutex> protect(mutex);
|
||||
std::unique_lock<Mutex> lock(mutex);
|
||||
|
||||
while (true) {
|
||||
switch (state) {
|
||||
@@ -179,7 +179,7 @@ private:
|
||||
}
|
||||
|
||||
if (state == State::INITIAL)
|
||||
cond.wait(mutex);
|
||||
cond.wait(lock);
|
||||
break;
|
||||
|
||||
case State::CONNECTING:
|
||||
|
Reference in New Issue
Block a user