Skip to content
Snippets Groups Projects
Commit 3c02a51a authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Only do one idle job at a time

parent b130a11c
No related branches found
No related tags found
1 merge request!97Resolves #160 by resync of clock
Pipeline #13003 passed
......@@ -61,10 +61,9 @@ static void waitTimePoint() {
}
// Still lots of time so do some idle jobs
while (msdelay >= 10 && sincelast != mspf) {
for (auto &j : jobs[kTimerIdle10]) {
j.job(now);
}
auto idle_job = jobs[kTimerIdle10].begin();
while (idle_job != jobs[kTimerIdle10].end() && msdelay >= 10 && sincelast != mspf) {
(*idle_job++).job(now);
now = get_time();
msdelay = mspf - (now % mspf);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment