Notifier: reset updatedAlarm before waiting (#946)

- If this isn't done, then the wait will always be performed at least twice
This commit is contained in:
Dustin Spicuzza
2018-05-04 21:29:42 -04:00
committed by Peter Johnson
parent 7a34f5d17d
commit b7ea481bf9

View File

@@ -136,6 +136,9 @@ uint64_t HAL_WaitForNotifierAlarm(HAL_NotifierHandle notifierHandle,
waitTime = notifier->waitTime * 1e-6;
}
// Don't wait twice
notifier->updatedAlarm = false;
auto timeoutTime =
hal::fpga_clock::epoch() + std::chrono::duration<double>(waitTime);
notifier->cond.wait_until(lock, timeoutTime);