Skip to content

Commit

Permalink
Synchonize all access to periodic tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-webb committed Dec 21, 2024
1 parent b087e5a commit a2db9f3
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 @@ -345,12 +345,12 @@ void ThreadUtility::priv_data::doPeriodicTasks()
{
while (!this->terminated)
{
if (this->jobs.empty())
break;
auto currentTime = std::chrono::system_clock::now();
TimePoint nextOperationTime = currentTime + this->maxDelay;
{
std::lock_guard<std::mutex> lock(this->job_mutex);
if (this->jobs.empty())
break;
for (auto& item : this->jobs)
{
if (this->terminated)
Expand Down

0 comments on commit a2db9f3

Please sign in to comment.