69 void setJobName (
const String& newName);
118 void signalJobShouldExit();
141 std::atomic<bool> shouldStop {
false }, isActive {
false }, shouldBeDeleted {
false };
142 ListenerList<Thread::Listener, Array<Thread::Listener*, CriticalSection>> listeners;
144 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ThreadPoolJob)
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)
Holds a resizable array of primitive or copy-by-value objects.
An array designed for holding objects.
A special array for holding a list of strings.
A task that is executed by a ThreadPool object.
JobStatus
These are the values that can be returned by the runJob() method.
bool isRunning() const noexcept
Returns true if this job is currently running its runJob() method.
bool shouldExit() const noexcept
Returns true if something is trying to interrupt this job and make it stop.
virtual JobStatus runJob()=0
Performs the actual work that this job needs to do.
A callback class used when you need to select which ThreadPoolJob objects are suitable for some kind ...
virtual bool isJobSuitable(ThreadPoolJob *job)=0
Should return true if the specified thread matches your criteria for whatever operation that this obj...
A set of threads that will run a list of jobs.
Used to receive callbacks for thread exit calls.
Allows threads to wait for events triggered by other threads.
#define JUCE_API
This macro is added to all JUCE public class declarations.