An implementation of the TaskScheduler
instance that uses a thread pool.
More...
#include <ThreadPoolTaskScheduler.h>
|
using | CallFuncType = std::function< void()> |
| An alias for the abstract interface input.
|
|
An implementation of the TaskScheduler
instance that uses a thread pool.
◆ ThreadPoolTaskScheduler()
olp::thread::ThreadPoolTaskScheduler::ThreadPoolTaskScheduler |
( |
size_t |
thread_count = 1u | ) |
|
|
explicit |
Creates the ThreadPoolTaskScheduler
object with one thread.
- Parameters
-
thread_count | The number of threads initialized in the thread pool. |
◆ EnqueueTask() [1/2]
Overrides the base class method to enqueue tasks and execute them on the next free thread from the thread pool.
- Note
- Tasks added with this method has Priority::NORMAL priority.
- Parameters
-
func | The rvalue reference of the task that should be enqueued. Move this task into your queue. No internal references are kept. Once this method is called, you own the task. |
Implements olp::thread::TaskScheduler.
◆ EnqueueTask() [2/2]
Overrides the base class method to enqueue tasks and execute them on the next free thread from the thread pool.
- Parameters
-
func | The rvalue reference of the task that should be enqueued. Move this task into your queue. No internal references are kept. Once this method is called, you own the task. |
priority | The priority of the task. Tasks with higher priority executes earlier. |
Reimplemented from olp::thread::TaskScheduler.
The documentation for this class was generated from the following file: