Skip to content

Commit

Permalink
Stop periodic task thread when all jobs have been removed
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-webb committed Jan 15, 2025
1 parent 7972fdd commit f5a0c21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/cpp/threadutility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ void ThreadUtility::priv_data::doPeriodicTasks()
if (this->jobs.end() == pItem)
break;
this->jobs.erase(pItem);
if (this->jobs.empty())
return;
}
if (this->jobs.empty())
break;

std::unique_lock<std::mutex> lock(this->interrupt_mutex);
this->interrupt.wait_until(lock, nextOperationTime);
Expand Down

0 comments on commit f5a0c21

Please sign in to comment.