Skip to content

Commit d7b302a

Browse files
authored
Wake up chrono controller when RTF is zero (#182)
Currently if the RTF is zero, chronocontroller will remain waiting until the RTF or the time changes. This is a problem if we ever want a chrono controller task to run at the same time as `now()` and time is frozen. This PR fixes this by allowing chronocontroller to wake up when RTF is zero.
1 parent 733b870 commit d7b302a

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/extension/ChronoController.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,7 @@ namespace extension {
166166

167167
if (clock::rtf() == 0.0) {
168168
// If we are paused then just wait until we are unpaused
169-
wait.wait(lock, [this, &start] {
170-
return !running.load(std::memory_order_acquire) || clock::rtf() != 0.0
171-
|| NUClear::clock::now() != start;
172-
});
169+
wait.wait(lock);
173170
}
174171
else if (time_until_task > cv_accuracy) { // A long time in the future
175172
// Wait on the cv

0 commit comments

Comments
 (0)