Commit f75fb2ea authored by Jason Rhinelander's avatar Jason Rhinelander
Browse files

Fix Ctrl-C not aborting delayed jobs

abort_jobs was only checked when entering the job loop, but if a job
entered the loop then had to wait, it didn't check abort_jobs again, so
the delayed jobs would start up even after a Ctrl-C was received.
parent 59f0070f
......@@ -356,13 +356,15 @@ void thread_runner(std::promise<void> started, const std::pair<std::string, std:
// release the lock and sleep until the appropriate time. Do this repeatedly,
// because when we wake up, some other thread might have already started and pushed
// back the earliest start time.
while (started < until) {
while (!abort_jobs && started < until) {
lock.unlock();
std::this_thread::sleep_until(until);
lock.lock();
started = std::chrono::high_resolution_clock::now();
until = host_next_conn[hostname];
}
if (abort_jobs) break;
}
check_date_change();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment