|
|
|
@@ -254,26 +254,26 @@ public: |
|
|
|
JobSelector* selectedJobsToRemove = nullptr);
|
|
|
|
|
|
|
|
/** Returns the number of jobs currently running or queued. */
|
|
|
|
int getNumJobs() const;
|
|
|
|
int getNumJobs() const noexcept;
|
|
|
|
|
|
|
|
/** Returns the number of threads assigned to this thread pool. */
|
|
|
|
int getNumThreads() const;
|
|
|
|
int getNumThreads() const noexcept;
|
|
|
|
|
|
|
|
/** Returns one of the jobs in the queue.
|
|
|
|
|
|
|
|
Note that this can be a very volatile list as jobs might be continuously getting shifted
|
|
|
|
around in the list, and this method may return nullptr if the index is currently out-of-range.
|
|
|
|
*/
|
|
|
|
ThreadPoolJob* getJob (int index) const;
|
|
|
|
ThreadPoolJob* getJob (int index) const noexcept;
|
|
|
|
|
|
|
|
/** Returns true if the given job is currently queued or running.
|
|
|
|
|
|
|
|
@see isJobRunning()
|
|
|
|
*/
|
|
|
|
bool contains (const ThreadPoolJob* job) const;
|
|
|
|
bool contains (const ThreadPoolJob* job) const noexcept;
|
|
|
|
|
|
|
|
/** Returns true if the given job is currently being run by a thread. */
|
|
|
|
bool isJobRunning (const ThreadPoolJob* job) const;
|
|
|
|
bool isJobRunning (const ThreadPoolJob* job) const noexcept;
|
|
|
|
|
|
|
|
/** Waits until a job has finished running and has been removed from the pool.
|
|
|
|
|
|
|
|
@@ -286,6 +286,11 @@ public: |
|
|
|
bool waitForJobToFinish (const ThreadPoolJob* job,
|
|
|
|
int timeOutMilliseconds) const;
|
|
|
|
|
|
|
|
/** If the given job is in the queue, this will move it to the front so that it
|
|
|
|
is the next one to be executed.
|
|
|
|
*/
|
|
|
|
void moveJobToFront (const ThreadPoolJob* jobToMove) noexcept;
|
|
|
|
|
|
|
|
/** Returns a list of the names of all the jobs currently running or queued.
|
|
|
|
If onlyReturnActiveJobs is true, only the ones currently running are returned.
|
|
|
|
*/
|
|
|
|
|