Orocos Real-Time Toolkit
2.9.0
|
A class which represents the main() thread. More...
#include <rtt/os/MainThread.hpp>
Public Member Functions | |
virtual | ~MainThread () |
virtual bool | start () |
Always fails. More... | |
virtual bool | stop () |
Always fails. More... | |
virtual Seconds | getPeriod () const |
Returns zero. More... | |
virtual bool | setPeriod (Seconds period) |
Returns always false. More... | |
virtual nsecs | getPeriodNS () const |
Returns zero. More... | |
virtual bool | isRunning () const |
Returns always true. More... | |
virtual bool | isActive () const |
Returns always true. More... | |
virtual const char * | getName () const |
Returns "main". More... | |
virtual RTOS_TASK * | getTask () |
Get the RTOS_TASK pointer. More... | |
virtual const RTOS_TASK * | getTask () const |
const version of the above. More... | |
virtual bool | setScheduler (int sched_type) |
Change the scheduler policy in which this thread runs. More... | |
virtual int | getScheduler () const |
Get the scheduler policy in which this thread runs. More... | |
virtual bool | setPriority (int priority) |
Set the priority of this Thread. More... | |
virtual int | getPriority () const |
The priority of this Thread. More... | |
virtual unsigned int | getPid () const |
Returns the Process or Thread ID of this thread, as assigned by the Operating System. More... | |
virtual unsigned | getCpuAffinity () const |
virtual void | setMaxOverrun (int m) |
virtual int | getMaxOverrun () const |
virtual void | setWaitPeriodPolicy (int p) |
Set the wait policy of a periodic thread. More... | |
virtual void | yield () |
Yields (put to the back of the scheduler queue) the calling thread. More... | |
unsigned int | threadNumber () const |
Returns zero, the number of the main() thread. More... | |
bool | isSelf () const |
Static Public Member Functions | |
static ThreadInterface * | Instance () |
Return an object which represents the main thread. More... | |
static void | Release () |
This is called to cleanup the main thread. More... | |
Protected Attributes | |
int | threadnb |
Threads are given an unique number, which follows thread creation order. More... | |
A class which represents the main() thread.
Definition at line 52 of file MainThread.hpp.
|
virtual |
Definition at line 54 of file MainThread.cpp.
References RTT::os::rtos_task_delete_main().
|
virtual |
Implements RTT::os::ThreadInterface.
Definition at line 114 of file MainThread.cpp.
References RTT::os::rtos_task_get_cpu_affinity().
|
virtual |
Implements RTT::os::ThreadInterface.
Definition at line 128 of file MainThread.cpp.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Returns the Process or Thread ID of this thread, as assigned by the Operating System.
This function tries to return the Thread ID, if the OS supports it, otherwise it returns the process ID. If that is not available either, zero is returned. On Linux systems for example, the Thread ID of the main thread is equal to the Process ID. The Thread ID of every newly created thread is different from the Process ID (and unique).
Implements RTT::os::ThreadInterface.
Definition at line 109 of file MainThread.cpp.
References RTT::os::rtos_task_get_pid().
|
virtual |
The priority of this Thread.
Implements RTT::os::ThreadInterface.
Definition at line 104 of file MainThread.cpp.
References RTT::os::rtos_task_get_priority().
|
virtual |
Get the scheduler policy in which this thread runs.
Implements RTT::os::ThreadInterface.
Definition at line 94 of file MainThread.cpp.
References RTT::os::rtos_task_get_scheduler().
|
virtual |
Get the RTOS_TASK pointer.
Implements RTT::os::ThreadInterface.
Definition at line 84 of file MainThread.cpp.
|
virtual |
const version of the above.
Implements RTT::os::ThreadInterface.
Definition at line 86 of file MainThread.cpp.
|
static |
Return an object which represents the main thread.
Only after this call, OS calls may be done.
Definition at line 58 of file MainThread.cpp.
Referenced by __os_init(), RTT::extras::TimerThread::Instance(), RTT::extras::SimulationThread::simthread(), RTT::extras::SequentialActivity::thread(), RTT::extras::SlaveActivity::thread(), and RTT::extras::FileDescriptorSimulationActivity::thread().
|
virtual |
Returns always true.
Implements RTT::os::ThreadInterface.
Definition at line 80 of file MainThread.cpp.
|
virtual |
Returns always true.
Implements RTT::os::ThreadInterface.
Definition at line 79 of file MainThread.cpp.
|
inherited |
Definition at line 58 of file ThreadInterface.cpp.
References RTT::os::ThreadInterface::getTask(), and RTT::os::rtos_task_is_self().
Referenced by RTT::ExecutionEngine::isSelf().
|
static |
This is called to cleanup the main thread.
After this call, no OS calls may be done.
Definition at line 66 of file MainThread.cpp.
Referenced by __os_exit().
|
virtual |
Implements RTT::os::ThreadInterface.
Definition at line 124 of file MainThread.cpp.
|
virtual |
Returns always false.
Implements RTT::os::ThreadInterface.
Definition at line 119 of file MainThread.cpp.
|
virtual |
Set the priority of this Thread.
priority | The priority given upon construction of this thread. It has to be interpreted in the current OS scheduler. |
Implements RTT::os::ThreadInterface.
Definition at line 99 of file MainThread.cpp.
References RTT::os::rtos_task_set_priority().
|
virtual |
Change the scheduler policy in which this thread runs.
sched_type | An OS-specific value which selects a scheduler. Orocos requires that these two values are available:
|
Your OS can in addition provide other sched_type's which map more naturally to the schedulers present. If your OS does not make a distinction between real-time and other, both values may map to the same scheduler type.
Implements RTT::os::ThreadInterface.
Definition at line 88 of file MainThread.cpp.
References RTT::os::rtos_task_set_scheduler().
|
virtual |
Set the wait policy of a periodic thread.
The | wait policy can be ORO_WAIT_ABS (absolute wait) and ORO_WAIT_REL (relative wait, with respect to current time) |
Implements RTT::os::ThreadInterface.
Definition at line 133 of file MainThread.cpp.
References RTT::os::rtos_task_set_wait_period_policy().
|
virtual |
|
virtual |
unsigned int RTT::os::MainThread::threadNumber | ( | ) | const |
Returns zero, the number of the main() thread.
Definition at line 143 of file MainThread.cpp.
|
virtual |
Yields (put to the back of the scheduler queue) the calling thread.
Implements RTT::os::ThreadInterface.
Definition at line 138 of file MainThread.cpp.
References RTT::os::rtos_task_yield().
|
protectedinherited |
Threads are given an unique number, which follows thread creation order.
Definition at line 229 of file ThreadInterface.hpp.
Referenced by RTT::os::ThreadInterface::ThreadInterface().