knowrob
2.1.0
A Knowledge Base System for Cognition-enabled Robots
|
#include <ThreadPool.h>
Public Member Functions | |
Runner () | |
virtual | ~Runner () |
Runner (const Runner &)=delete | |
void | join () |
virtual void | run ()=0 |
void | stop (bool wait) |
bool | hasStopRequest () const |
bool | isTerminated () const |
Runner () | |
virtual | ~Runner () |
Runner (const Runner &)=delete | |
void | join () |
virtual void | run ()=0 |
void | stop (bool wait) |
bool | hasStopRequest () const |
bool | isTerminated () const |
Protected Member Functions | |
void | runInternal () |
void | setExceptionHandler (ExceptionHandler exceptionHandler) |
void | runInternal () |
void | setExceptionHandler (ExceptionHandler exceptionHandler) |
Protected Attributes | |
std::atomic< bool > | isTerminated_ |
std::atomic< bool > | isRunning_ |
std::atomic< bool > | hasStopRequest_ |
std::mutex | mutex_ |
std::condition_variable | finishedCV_ |
ExceptionHandler | exceptionHandler_ |
Friends | |
class | ThreadPool::Worker |
class | ThreadPool |
An object that provides a run function which is evaluated in a worker thread.
Definition at line 93 of file ThreadPool.h.
ThreadPool::Runner::Runner | ( | ) |
Definition at line 161 of file ThreadPool.cpp.
|
virtual |
Definition at line 167 of file ThreadPool.cpp.
|
delete |
Cannot be copy-assigned.
knowrob::ThreadPool::Runner::Runner | ( | ) |
|
virtual |
|
delete |
Cannot be copy-assigned.
|
inline |
|
inline |
|
inline |
|
inline |
void ThreadPool::Runner::join | ( | ) |
Wait until run function has exited.
Definition at line 171 of file ThreadPool.cpp.
void knowrob::ThreadPool::Runner::join | ( | ) |
Wait until run function has exited.
|
pure virtual |
Run the computation in a worker thread.
Implemented in knowrob::ThreadPool::LambdaRunner, knowrob::ReasonerRunner, knowrob::ThreadPool::LambdaRunner, and knowrob::ReasonerRunner.
|
pure virtual |
Run the computation in a worker thread.
Implemented in knowrob::ThreadPool::LambdaRunner, knowrob::ReasonerRunner, knowrob::ThreadPool::LambdaRunner, and knowrob::ReasonerRunner.
|
protected |
Definition at line 178 of file ThreadPool.cpp.
|
protected |
|
inlineprotected |
Definition at line 140 of file ThreadPool.h.
|
inlineprotected |
Definition at line 140 of file ThreadPool.h.
void ThreadPool::Runner::stop | ( | bool | wait | ) |
Stop the runner.
wait | call blocks until runner exited if true. |
Definition at line 215 of file ThreadPool.cpp.
void knowrob::ThreadPool::Runner::stop | ( | bool | wait | ) |
Stop the runner.
wait | call blocks until runner exited if true. |
|
friend |
Definition at line 144 of file ThreadPool.h.
|
friend |
Definition at line 142 of file ThreadPool.h.
|
protected |
Definition at line 136 of file ThreadPool.h.
|
protected |
Definition at line 135 of file ThreadPool.h.
|
protected |
Definition at line 133 of file ThreadPool.h.
|
protected |
Definition at line 132 of file ThreadPool.h.
|
protected |
Definition at line 131 of file ThreadPool.h.
|
protected |
Definition at line 134 of file ThreadPool.h.