scheduler: Replace stop(true) with StopWhenDrained()

This helps understanding the code at the call site without having to
look up the name of the argument or the default value.
This commit is contained in:
MarcoFalke 2020-05-28 08:43:25 -04:00
parent fa9cca0550
commit fac43f9889
No known key found for this signature in database
GPG key ID: CE2B75697E69A548
3 changed files with 15 additions and 19 deletions

View file

@ -68,18 +68,6 @@ void CScheduler::serviceQueue()
newTaskScheduled.notify_one();
}
void CScheduler::stop(bool drain)
{
{
LOCK(newTaskMutex);
if (drain)
stopWhenEmpty = true;
else
stopRequested = true;
}
newTaskScheduled.notify_all();
}
void CScheduler::schedule(CScheduler::Function f, std::chrono::system_clock::time_point t)
{
{