69 void setJobName (
const String& newName);
118 void signalJobShouldExit();
141 std::atomic<bool> shouldStop {
false }, isActive {
false }, shouldBeDeleted {
false };
172 ThreadPool (
int numberOfThreads,
size_t threadStackSize = 0);
225 bool deleteJobWhenFinished);
235 void addJob (std::function<
void()> job);
255 bool interruptIfRunning,
256 int timeOutMilliseconds);
269 bool removeAllJobs (
bool interruptRunningJobs,
270 int timeOutMilliseconds,
274 int getNumJobs()
const noexcept;
277 int getNumThreads()
const noexcept;
304 int timeOutMilliseconds)
const;
309 void moveJobToFront (
const ThreadPoolJob* jobToMove) noexcept;
314 StringArray getNamesOfAllJobs (
bool onlyReturnActiveJobs)
const;
320 bool setThreadPriorities (
int newPriority);
337 void createThreads (
int numThreads,
size_t threadStackSize = 0);
342 void removeAllJobs (
bool,
int,
bool);
344 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (
ThreadPool)
#define JUCE_API
This macro is added to all JUCE public class declarations.
A callback class used when you need to select which ThreadPoolJob objects are suitable for some kind ...
Allows threads to wait for events triggered by other threads.
A special array for holding a list of strings.
Holds a set of objects and can invoke a member function callback on each object in the set with a sin...
JobStatus
These are the values that can be returned by the runJob() method.
Used to receive callbacks for thread exit calls.
bool isRunning() const noexcept
Returns true if this job is currently running its runJob() method.
Holds a resizable array of primitive or copy-by-value objects.
An array designed for holding objects.
A task that is executed by a ThreadPool object.
A set of threads that will run a list of jobs.
bool shouldExit() const noexcept
Returns true if something is trying to interrupt this job and make it stop.