1
0
Fork 0

Fix double locking of mutex of condition variable.

This commit is contained in:
Max Neunhoeffer 2016-05-06 23:25:19 +02:00
parent b37d8fff48
commit 7ed306c2e7
1 changed files with 6 additions and 4 deletions

View File

@ -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";