#include <exec_serv.h>
Public Member Functions | |
virtual void | shutdown ()=0 |
call this method to mark executor as shutdown. No further tasks can be accepted by the executor. Tasks already submitted will be executed. | |
virtual void | halt ()=0 |
call this method to mark executor as halt. No further tasks can be accepted by the executor. Tasks already submitted but not started will be canceled. TODO: this function shoud return a list of un-started tasks | |
virtual bool | finished ()=0 |
virtual void | waitTermination () |
Block caller thread until all tasks inside the executor get executed. shutdown() or halt() method must be called before this method. | |
virtual bool | waitTermination (int timeOut) |
Block caller thread until all tasks inside the executor get executed or timeout is reached. Shutdown() or halt() method must be called before this method. | |
Protected Member Functions | |
void | notify_finish () |
Protected Attributes | |
volatile bool | fShutdown |
condition_variable | condFinish |
recursive_mutex | f_mutex_finish |
void amino::ExecutorService::notify_finish | ( | ) | [inline, protected] |
virtual void amino::ExecutorService::shutdown | ( | ) | [pure virtual] |
call this method to mark executor as shutdown. No further tasks can be accepted by the executor. Tasks already submitted will be executed.
Implemented in amino::SingleExecutor, and amino::ThreadPoolExecutor.
virtual void amino::ExecutorService::halt | ( | ) | [pure virtual] |
call this method to mark executor as halt. No further tasks can be accepted by the executor. Tasks already submitted but not started will be canceled. TODO: this function shoud return a list of un-started tasks
Implemented in amino::SingleExecutor, and amino::ThreadPoolExecutor.
virtual bool amino::ExecutorService::finished | ( | ) | [pure virtual] |
Implemented in amino::SingleExecutor, and amino::ThreadPoolExecutor.
virtual void amino::ExecutorService::waitTermination | ( | ) | [inline, virtual] |
Block caller thread until all tasks inside the executor get executed. shutdown() or halt() method must be called before this method.
Reimplemented in amino::ThreadPoolExecutor.
virtual bool amino::ExecutorService::waitTermination | ( | int | timeOut | ) | [inline, virtual] |
Block caller thread until all tasks inside the executor get executed or timeout is reached. Shutdown() or halt() method must be called before this method.
timeOut | timeout in millisecond |
Reimplemented in amino::ThreadPoolExecutor.
volatile bool amino::ExecutorService::fShutdown [protected] |
condition_variable amino::ExecutorService::condFinish [protected] |