Basic Thread Pool implemented as a singleton.
More...
#include <ThreadPool.hpp>
|
class | Job |
| Abstract class representing a job for the ThreadPool. It is designed to be inherited to define the job. More...
|
|
|
enum | Importance { Normal,
High
} |
| Enumeration of job importance levels.
|
|
Basic Thread Pool implemented as a singleton.
- Note
- This is primarily used for texture generation, therefore use for your own tasks is not guaranteed to be a good idea!
◆ getInstance()
static ThreadPool* Aether::ThreadPool::getInstance |
( |
| ) |
|
|
static |
Returns the instance of the ThreadPool. One is created if it does not already exist.
- Returns
- ThreadPool instance
◆ maxConcurrentJobs()
size_t Aether::ThreadPool::maxConcurrentJobs |
( |
| ) |
|
Returns the maximum number of jobs that can be executed concurrently.
- Returns
- Maximum number of concurrent jobs (threads)
◆ queueJob()
int Aether::ThreadPool::queueJob |
( |
Job * |
job, |
|
|
const Importance |
importance |
|
) |
| |
Adds a job to the queue. The job object is deleted once it is complete.
- Parameters
-
job | Job to queue |
importance | The importance of the job (see Importance) |
- Returns
- ID of job
◆ removeOrWaitForJob()
void Aether::ThreadPool::removeOrWaitForJob |
( |
int |
id | ) |
|
Removes the requested job from the queue, or waits until the job is completed if already running. Does nothing if the id is not found.
- Parameters
-
The documentation for this class was generated from the following file: