It is meant to group all packages which provide OS abstraction classes and functions in a realtime system. Examples are Threads, Mutexes and standard libraries.
Classes | |
| class | AtomicInt |
| C++ abstraction of atomic integer operations. More... | |
| class | MainThread |
| A class which represents the main() thread. More... | |
| class | MutexInterface |
| An interface to a Mutex. More... | |
| class | Mutex |
| An object oriented wrapper around a non recursive mutex. More... | |
| class | MutexRecursive |
| An object oriented wrapper around a recursive mutex. More... | |
| class | MutexLock |
| MutexLock is a scope based Monitor, protecting critical sections with a Mutex object through locking and unlocking it. More... | |
| class | MutexTryLock |
| A MutexTryLock tries to lock an Mutex object on construction and if successful, unlocks it on destruction of the MutexTryLock. More... | |
| class | PeriodicThread |
| A PeriodicThread executes its step() method (or a RunnableInterface ) periodically. More... | |
| class | RunnableInterface |
| A class for running a certain piece of code in a thread. More... | |
| class | Semaphore |
| An object oriented wrapper around a counting semaphore. More... | |
| class | SingleThread |
| This Thread abstraction class represents a single-shot thread which can be started many times. More... | |
| class | StartStopManager |
| This manager starts and stops all globally registered start/stop functions, without a particular order. More... | |
| struct | InitFunction |
| Use this to register a global init function to the StartStopManager. More... | |
| struct | CleanupFunction |
| Use this to register a global cleanup function to the StartStopManager. More... | |
| class | ThreadInterface |
| A thread which is being run (or runs a RunnableInterface). More... | |
Typedefs | |
| typedef double | Seconds |
| typedef long | secs |
| typedef long | msecs |
| typedef long | usecs |
| typedef long long | nsecs |
Functions | |
| template<class T, class V, class W> | |
| bool | CAS (volatile T *addr, const V &expected, const W &value) |
| Compare And Swap. | |
| void * | periodicThread (void *t) |
| void * | singleThread_f (void *t) |
| bool | CheckScheduler (int &sched_type) |
| Check if the scheduler is a valid type in the current process and adapt to a valid value. | |
| bool | CheckPriority (int &sched_type, int &priority) |
| Check if the scheduler type and priority match and adapt to a valid value. | |
| msecs | secs_to_msecs (const secs s) |
| usecs | secs_to_usecs (const secs s) |
| nsecs | secs_to_nsecs (const secs s) |
| usecs | msecs_to_usecs (const msecs ms) |
| nsecs | msecs_to_nsecs (const msecs ms) |
| nsecs | usecs_to_nsecs (const usecs us) |
| nsecs | Seconds_to_nsecs (const Seconds s) |
| Seconds | nsecs_to_Seconds (const nsecs ns) |
Variables | |
| const int | LowestPriority = 0 |
| An integer denoting the lowest priority of the selected OS. | |
| const int | HighestPriority = 63 |
| An integer denoting the highest priority of the selected OS. | |
| const int | IncreasePriority = 1 |
| An interval to be added 'n' times to LowestPriority to get an 'n' times higher priority. | |
| AtomicInt | threads (0) |
| The number of threads in addition to the main() thread. | |
| const long | MSECS_IN_SECS = 1000 |
| const long | USECS_IN_SECS = 1000 * MSECS_IN_SECS |
| const long | NSECS_IN_SECS = 1000 * USECS_IN_SECS |
| const long | USECS_IN_MSECS = 1000 |
| const long | NSECS_IN_MSECS = 1000 * USECS_IN_MSECS |
| const long | NSECS_IN_USECS = 1000 |
| bool RTT::OS::CAS | ( | volatile T * | addr, | |
| const V & | expected, | |||
| const W & | value | |||
| ) | [inline] |
Compare And Swap.
Also known as Compare Exchange (cmpxch). If addr contains expected, replace it with value, and return true. Otherwise, return false.
Definition at line 54 of file CAS.hpp.
Referenced by ListLockFree< RTT::detail::EventCatcher * >::append(), AtomicQueue< void * >::dequeue(), AtomicQueue< void * >::enqueue(), SortedList::erase(), SingleList::erase(), ListLockFree< RTT::detail::EventCatcher * >::erase(), SortedList::insert(), SingleList::insert(), and ListLockFree< RTT::detail::EventCatcher * >::reserve().
| bool CheckPriority | ( | int & | sched_type, | |
| int & | priority | |||
| ) |
Check if the scheduler type and priority match and adapt to a valid value.
If sched_type is unknown a default is choosen. If priority is invalid within sched_type, a default is choosen.
Definition at line 53 of file threads.cpp.
Referenced by TimerThread::Instance().
| bool CheckScheduler | ( | int & | sched_type | ) |
Check if the scheduler is a valid type in the current process and adapt to a valid value.
Definition at line 48 of file threads.cpp.
Referenced by PeriodicThread::setScheduler().
| void* RTT::OS::periodicThread | ( | void * | t | ) |
This is one time initialisation
The real task starts here.
Definition at line 55 of file PeriodicThread.cpp.
References PeriodicThread::confDone, PeriodicThread::configure(), PeriodicThread::emergencyStop(), PeriodicThread::getName(), PeriodicThread::getTask(), Logger::log(), PeriodicThread::maxOverRun, Logger::nl(), PeriodicThread::prepareForExit, PeriodicThread::running, PeriodicThread::sem, PeriodicThread::step(), and ThreadInterface::threadNumber().
| void* RTT::OS::singleThread_f | ( | void * | t | ) |
This is one time initialisation
The real task starts here.
Definition at line 57 of file SingleThread.cpp.
References SingleThread::active, SingleThread::breaker, SingleThread::confDone, SingleThread::finalize(), SingleThread::getName(), SingleThread::getTask(), SingleThread::inloop, Logger::log(), SingleThread::loop(), SingleThread::msched_type, SingleThread::prepareForExit, SingleThread::runloop, SingleThread::sem, and ThreadInterface::threadNumber().
The number of threads in addition to the main() thread.
The main thread is thread zero (0). threads is increased by one for each PeriodicThread or SingleThread object created and is never decreased.
Definition at line 53 of file threads.hpp.
Referenced by AtomicQueue< void * >::AtomicQueue(), and ListLockFree< RTT::detail::EventCatcher * >::ListLockFree().
1.5.6