|
| Scheduler () |
| Creates a new scheduler.
|
|
virtual | ~Scheduler () |
| Destructs a scheduler.
|
|
virtual void | threadRun () |
| Derived thread run function.
|
|
| Singleton ()=default |
| Default constructor.
|
|
| Thread (const Thread &thread)=delete |
| Disabled copy constructor.
|
|
void | createThread () |
| Creates the thread itself.
|
|
void | destroyThread () |
| Destroys the thread itself.
|
|
void | stopThreadExplicitly (const unsigned int timeout=5000u) |
| Tries to stop the thread gracefully.
|
|
Thread & | operator= (const Thread &thread)=delete |
| The disabled assign operator.
|
|
| Thread (const std::string &name=std::string()) |
| Creates a new thread object.
|
|
| Thread (const unsigned int randomNumberSeedValue, const std::string &name=std::string()) |
| Creates a new thread object.
|
|
virtual | ~Thread () |
| Destructs a thread object.
|
|
bool | startThread () |
| Starts the thread.
|
|
void | stopThread () |
| Informs the thread to stop.
|
|
bool | terminateThread () |
| Terminates the thread.
|
|
bool | joinThread (const unsigned int timeout=(unsigned int)(-1)) |
| Waits until this thread has been stopped.
|
|
bool | shouldThreadStop () const |
| Returns whether this thread should stop.
|
|
bool | isThreadInvokedToStart () const |
| Returns whether this thread has been invoked to start immediately.
|
|
bool | isThreadActive () const |
| Returns whether this thread is active.
|
|
|
static Scheduler & | get () |
| Returns a reference to the unique object.
|
|
typedef std::pair< pthread_t, bool > | TimedJoinPair |
| Definition of a pair holding a thread id and a boolean state.
|
|
enum | ThreadPriority {
PRIORITY_IDLE
, PRIORTY_BELOW_NORMAL
, PRIORTY_NORMAL
, PRIORTY_ABOVE_NORMAL
,
PRIORTY_HIGH
, PRIORTY_REALTIME
} |
| Definition of different thread priority values. More...
|
|
static void | sleep (unsigned int ms) |
| Sleeps the calling thread for a given time.
|
|
static void | giveUp () |
| Gives up the remaining thread time.
|
|
static ThreadId | currentThreadId () |
| Returns the thread id of the current (calling) thread.
|
|
static ThreadPriority | threadPriority () |
| Returns the priority of the current thread.
|
|
static bool | setThreadPriority (const ThreadPriority priority) |
| Sets the priority of the current thread.
|
|
template<typename TObject , typename TExpectedValue > |
static bool | waitForValue (TObject &object, const TExpectedValue &expectedValue, const double timeout=-1.0) |
| Waits until an object/variable has an expected value.
|
|
template<typename TObject , typename TExpectedValue > |
static bool | waitForValue (TObject &object, const TExpectedValue &expectedValue, TemporaryScopedLock &temporaryScopedLock, const double timeout=-1.0) |
| Waits until an object/variable has an expected value.
|
|
static int | pthread_timedjoin_np (pthread_t thread, void **retval, const struct timespec *abstime) |
| Implements a thread join function with timeout value.
|
|
This class represents a round robin scheduler.
The scheduler is based on one single thread and executes all registered functions in a round robin manner.
The registered functions are called with high frequency (e.g., each 10-50 ms).
A registered function should return immediately so that a high call frequency for all registered function can be ensured.
- See also
- ThreadPool, TaskQueue.