OS Abstractions such as Mutexes, Semaphores and Threads. More...
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 | MutexTimedLock |
A MutexTimedLock locks a Mutex object on construction and if successful, unlocks it on destruction of the MutexTimedLock. More... | |
class | local_allocator |
A simple local allocator which keeps a small pool which you can grow manually with grow(). More... | |
class | rt_allocator |
A real-time malloc allocator which allocates every block with oro_rt_malloc() and deallocates with oro_rt_free(). More... | |
class | PeriodicThread |
A PeriodicThread executes its step() method (or a RunnableInterface ) periodically. More... | |
struct | rt_list |
Implements a list with real-time insertion/removal of elements. 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 | Thread |
A Thread object executes user code in its own thread. 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. | |
template<class T , class A , class A2 > | |
bool | operator== (const local_allocator< T, A > &, const local_allocator< T, A2 > &) |
template<class T , class A , class A2 > | |
bool | operator!= (const local_allocator< T, A > &, const local_allocator< T, A2 > &) |
template<class T , class A > | |
bool | operator== (const local_allocator< T, A > &, const local_allocator< T, A > &) |
template<class T , class A > | |
bool | operator!= (const local_allocator< T, A > &, const local_allocator< T, A > &) |
template<class T > | |
bool | operator== (const rt_allocator< T > &, const rt_allocator< T > &) |
template<class T > | |
bool | operator!= (const rt_allocator< T > &, const rt_allocator< T > &) |
bool RTT_API | CheckScheduler (int &sched_type) |
Check if the scheduler is a valid type in the current process and adapt to a valid value. | |
bool RTT_API | 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 | |
AtomicInt RTT_API | threads |
The number of threads in addition to the main() thread. | |
const int RTT_API | LowestPriority |
An integer denoting the lowest priority of the selected OS. | |
const int RTT_API | HighestPriority |
An integer denoting the highest priority of the selected OS. | |
const int RTT_API | IncreasePriority |
An interval to be added 'n' times to LowestPriority to get an 'n' times higher priority. | |
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 |
OS Abstractions such as Mutexes, Semaphores and Threads.
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.
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 52 of file CAS.hpp.
Referenced by RTT::ListLockFree< detail::EventCatcher * >::append(), RTT::SortedList< DataType_ >::erase(), RTT::SingleList< DataType_ >::erase(), RTT::ListLockFree< detail::EventCatcher * >::erase(), RTT::SortedList< DataType_ >::insert(), RTT::SingleList< DataType_ >::insert(), and RTT::ListLockFree< detail::EventCatcher * >::reserve().
bool RTT_API RTT::OS::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.
bool RTT_API RTT::OS::CheckScheduler | ( | int & | sched_type | ) |
Check if the scheduler is a valid type in the current process and adapt to a valid value.
AtomicInt RTT_API RTT::OS::threads |
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.