mirror of https://gitee.com/bigwinds/arangodb
Fix double locking of mutex of condition variable.
This commit is contained in:
parent
b37d8fff48
commit
7ed306c2e7
|
@ -137,10 +137,12 @@ void AgencyCallback::executeByCallbackOrTimeout(double maxTimeout) {
|
|||
compareBuilder = _lastData;
|
||||
}
|
||||
|
||||
CONDITION_LOCKER(locker, _cv);
|
||||
_useCv = true;
|
||||
locker.wait(static_cast<uint64_t>(maxTimeout * 1000000.0));
|
||||
_useCv = false;
|
||||
{
|
||||
CONDITION_LOCKER(locker, _cv);
|
||||
_useCv = true;
|
||||
locker.wait(static_cast<uint64_t>(maxTimeout * 1000000.0));
|
||||
_useCv = false;
|
||||
}
|
||||
|
||||
if (!_lastData || _lastData->slice().equals(compareBuilder->slice())) {
|
||||
LOG(DEBUG) << "Waiting done and nothing happended. Refetching to be sure";
|
||||
|
|
Loading…
Reference in New Issue