Sunshine latest
Self-hosted game stream host for Moonlight.
thread_pool_util::ThreadPool Class Reference

#include <src/thread_pool.h>

Inheritance diagram for thread_pool_util::ThreadPool:
[legend]
Collaboration diagram for thread_pool_util::ThreadPool:
[legend]

Public Types

typedef TaskPool::__task __task
 
- Public Types inherited from task_pool_util::TaskPool
typedef std::unique_ptr< _ImplBase__task
 
typedef std::chrono::steady_clock::time_point __time_point
 
typedef _ImplBasetask_id_t
 

Public Member Functions

void _main ()
 
void join ()
 
template<class Function , class... Args>
auto push (Function &&newTask, Args &&...args)
 
template<class Function , class X , class Y , class... Args>
auto pushDelayed (Function &&newTask, std::chrono::duration< X, Y > duration, Args &&...args)
 
void pushDelayed (std::pair< __time_point, __task > &&task)
 
void start (int threads)
 
void stop ()
 
 ThreadPool (int threads)
 
- Public Member Functions inherited from task_pool_util::TaskPool
bool cancel (task_id_t task_id)
 
template<class X , class Y >
void delay (task_id_t task_id, std::chrono::duration< X, Y > duration)
 
std::optional< __time_point > next ()
 
TaskPooloperator= (TaskPool &&other) noexcept
 
std::optional< __task > pop ()
 
std::optional< std::pair< __time_point, __task > > pop (task_id_t task_id)
 
template<class Function , class... Args>
auto push (Function &&newTask, Args &&...args)
 
template<class Function , class X , class Y , class... Args>
auto pushDelayed (Function &&newTask, std::chrono::duration< X, Y > duration, Args &&...args)
 
void pushDelayed (std::pair< __time_point, __task > &&task)
 
bool ready ()
 
 TaskPool (TaskPool &&other) noexcept
 

Additional Inherited Members

- Protected Attributes inherited from task_pool_util::TaskPool
std::mutex _task_mutex
 
std::deque< __task > _tasks
 
std::vector< std::pair< __time_point, __task > > _timer_tasks
 

Detailed Description

Allow threads to execute unhindered while keeping full control over the threads.


The documentation for this class was generated from the following file: