Beatmup
|
Public Member Functions | |
TaskThreadImpl (ThreadIndex index, ThreadPool &pool) | |
virtual | ~TaskThreadImpl () |
ThreadIndex | numThreads () const |
bool | isTaskAborted () const |
Returns true if the task is asked to stop from outside. More... | |
void | synchronize () |
Blocks until all the other threads running the same task reach the same point. More... | |
Public Member Functions inherited from Beatmup::TaskThread | |
ThreadIndex | currentThread () const |
bool | isManaging () const |
Public Attributes | |
ThreadPool & | pool |
ThreadIndex | index |
current thread index More... | |
bool | isRunning |
if not, the thread sleeps More... | |
bool | isTerminating |
if true , the thread is requested to terminate More... | |
std::thread | internalThread |
worker thread More... | |
Private Member Functions | |
void | threadFunc () |
Additional Inherited Members | |
Protected Member Functions inherited from Beatmup::TaskThread | |
TaskThread (ThreadIndex index) | |
Protected Attributes inherited from Beatmup::TaskThread | |
ThreadIndex | index |
current thread index More... | |
Definition at line 38 of file thread_pool.hpp.
|
inline |
Definition at line 45 of file thread_pool.hpp.
|
inlinevirtual |
Definition at line 51 of file thread_pool.hpp.
|
inlineprivate |
Definition at line 40 of file thread_pool.hpp.
|
inlinevirtual |
Implements Beatmup::TaskThread.
Definition at line 53 of file thread_pool.hpp.
|
inlinevirtual |
Returns true
if the task is asked to stop from outside.
Implements Beatmup::TaskThread.
Definition at line 57 of file thread_pool.hpp.
|
inlinevirtual |
Blocks until all the other threads running the same task reach the same point.
"The same point" is the same number of calls to synchronize(). This function does not throw any exception to be caught in the task code. However, if a thread running the task has failed, this function throws an exception the thread pool takes care of. This ensures a valid thread pool state and avoids dead locks when a task fails to proceed.
Implements Beatmup::TaskThread.
Definition at line 61 of file thread_pool.hpp.
ThreadPool& Beatmup::ThreadPool::TaskThreadImpl::pool |
Definition at line 66 of file thread_pool.hpp.
ThreadIndex Beatmup::ThreadPool::TaskThreadImpl::index |
current thread index
Definition at line 67 of file thread_pool.hpp.
bool Beatmup::ThreadPool::TaskThreadImpl::isRunning |
if not, the thread sleeps
Definition at line 68 of file thread_pool.hpp.
bool Beatmup::ThreadPool::TaskThreadImpl::isTerminating |
if true
, the thread is requested to terminate
Definition at line 69 of file thread_pool.hpp.
std::thread Beatmup::ThreadPool::TaskThreadImpl::internalThread |
worker thread
Definition at line 70 of file thread_pool.hpp.