Mark3 Realtime Kernel
|
The Atomic namespace This utility module provides primatives for atomic operations - that is, operations that are guaranteed to execute uninterrupted. Basic atomic primatives provided here include Set/Add/Subtract, as well as an atomic test-and-set. More...
Functions | |
template<typename T > | |
T | Set (T *pSource_, T val_) |
Set Set a variable to a given value in an uninterruptable operation. More... | |
template<typename T > | |
T | Add (T *pSource_, T val_) |
Add Add a value to a variable in an uninterruptable operation. More... | |
template<typename T > | |
T | Sub (T *pSource_, T val_) |
Sub Subtract a value from a variable in an uninterruptable operation. More... | |
bool | TestAndSet (bool *pbLock) |
TestAndSet Test to see if a variable is set, and set it if is not already set. This is an uninterruptable operation. More... | |
The Atomic namespace This utility module provides primatives for atomic operations - that is, operations that are guaranteed to execute uninterrupted. Basic atomic primatives provided here include Set/Add/Subtract, as well as an atomic test-and-set.
T Mark3::Atomic::Add | ( | T * | pSource_, |
T | val_ | ||
) |
T Mark3::Atomic::Set | ( | T * | pSource_, |
T | val_ | ||
) |
T Mark3::Atomic::Sub | ( | T * | pSource_, |
T | val_ | ||
) |
bool Mark3::Atomic::TestAndSet | ( | bool * | pbLock | ) |
TestAndSet Test to see if a variable is set, and set it if is not already set. This is an uninterruptable operation.
If the value is false, set the variable to true, and return the previously-held value.
If the value is already true, return true.
pbLock | Pointer to a value to test against. This will always be set to "true" at the end of a call to TestAndSet. |
Definition at line 26 of file atomic.cpp.