1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added a method to ThreadPool to query the number of threads assigned to the pool

This commit is contained in:
hogliux 2016-10-27 16:21:00 +01:00
parent 56c5c8e8ac
commit 5d0256982b
2 changed files with 9 additions and 2 deletions

View file

@ -148,6 +148,11 @@ int ThreadPool::getNumJobs() const
return jobs.size();
}
int ThreadPool::getNumThreads() const
{
return threads.size();
}
ThreadPoolJob* ThreadPool::getJob (const int index) const
{
const ScopedLock sl (lock);

View file

@ -246,10 +246,12 @@ public:
int timeOutMilliseconds,
JobSelector* selectedJobsToRemove = nullptr);
/** Returns the number of jobs currently running or queued.
*/
/** Returns the number of jobs currently running or queued. */
int getNumJobs() const;
/** Returns the number of threads assigned to this thread pool. */
int getNumThreads() const;
/** Returns one of the jobs in the queue.
Note that this can be a very volatile list as jobs might be continuously getting shifted