53 void wait(uint nTimes = 1);
96 template<
typename T,
typename TEvent>
117 void worker(BOOL* keepAlive);
TaskManager(Application *app)
bool m_signaled
Wheter or not the event is currently signalled.
void reset()
Sets the event to unsignaled-mode.
uint m_signal
Wheter or not the event is currently signalled.
void signal()
Sets the event to signaled-mode.
condition_variable m_cv
A condition variable used for synchronization.
vector< thread > m_threads
The thread object for all worker-threads.
manual_reset_event(bool signaled=false)
auto_reset_event m_threadHasTodo
An event that tells workers wheter or not there is a task.
condition_variable m_cv
A condition variable used for synchronization.
void schedule(T fnc, TEvent *event=nullptr)
void signal()
Sets the event to signaled-mode.
vector< BOOL > m_threadKeepAlive
A a bool for each working-thread that tells it wheter or not to stay alive.
void worker(BOOL *keepAlive)
void signalN(uint n)
Sets the event to signaled-mode (N-times, i.e. to wake up N threads)
mutex m_mutex
A mutex used for synchronization.
void wait(uint nTimes=1)
Wait (block) until the event is set to signaled-mode.
concurrency::concurrent_queue< function< void()> > m_taskqueue
A queue of tasks that needs to be executed.
mutex m_mutex
A mutex used for synchronization.
void wait()
Wait (block) until the event is set to signaled-mode.