65 void setJobName (
const String& newName);
98 bool isRunning() const noexcept {
return isActive; }
114 void signalJobShouldExit();
137 std::atomic<bool> shouldStop {
false }, isActive {
false }, shouldBeDeleted {
false };
138 ListenerList<Thread::Listener, Array<Thread::Listener*, CriticalSection>> listeners;
140 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ThreadPoolJob)
168 ThreadPool (
int numberOfThreads,
size_t threadStackSize = 0);
221 bool deleteJobWhenFinished);
231 void addJob (std::function<
void()> job);
251 bool interruptIfRunning,
252 int timeOutMilliseconds);
265 bool removeAllJobs (
bool interruptRunningJobs,
266 int timeOutMilliseconds,
270 int getNumJobs() const noexcept;
273 int getNumThreads() const noexcept;
300 int timeOutMilliseconds) const;
305 void moveJobToFront (const
ThreadPoolJob* jobToMove) noexcept;
310 StringArray getNamesOfAllJobs (
bool onlyReturnActiveJobs) const;
316 bool setThreadPriorities (
int newPriority);
323 struct ThreadPoolThread;
330 bool runNextJob (ThreadPoolThread&);
333 void createThreads (
int numThreads,
size_t threadStackSize = 0);
338 void removeAllJobs (
bool,
int,
bool);
340 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (
ThreadPool)
bool isRunning() const noexcept
bool shouldExit() const noexcept
virtual JobStatus runJob()=0
virtual bool isJobSuitable(ThreadPoolJob *job)=0