mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
Added a ScopedLock in ThreadPool::getNumJobs() to fix a potential data race
This commit is contained in:
parent
290aad89f8
commit
ba2575a4d3
1 changed files with 1 additions and 0 deletions
|
|
@ -176,6 +176,7 @@ void ThreadPool::addJob (std::function<void()> jobToRun)
|
|||
|
||||
int ThreadPool::getNumJobs() const noexcept
|
||||
{
|
||||
const ScopedLock sl (lock);
|
||||
return jobs.size();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue