Browse Source

Added a ScopedLock in ThreadPool::getNumJobs() to fix a potential data race

tags/2021-05-28
ed 6 years ago
parent
commit
ba2575a4d3
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      modules/juce_core/threads/juce_ThreadPool.cpp

+ 1
- 0
modules/juce_core/threads/juce_ThreadPool.cpp View File

@@ -176,6 +176,7 @@ void ThreadPool::addJob (std::function<void()> jobToRun)
int ThreadPool::getNumJobs() const noexcept int ThreadPool::getNumJobs() const noexcept
{ {
const ScopedLock sl (lock);
return jobs.size(); return jobs.size();
} }


Loading…
Cancel
Save