39 #ifndef OS_COMMON_CAS_HPP 40 #define OS_COMMON_CAS_HPP 53 template<
class T,
class V,
class W >
54 inline bool CAS(
volatile T* addr,
const V& expected,
const W& value) {
55 return expected ==
oro_cmpxchg(addr, expected, value);
61 inline bool CAS(
volatile oro_atomic_t* addr,
const int expected,
const int value) {
64 return expected ==
oro_cmpxchg(&ref, expected, value);
int oro_atomic_read(oro_atomic_t *a)
Returns the current counter value of the atomic structure a.
#define oro_cmpxchg(ptr, o, n)
Compare o with *ptr and swap with n if equal.
bool CAS(volatile T *addr, const V &expected, const W &value)
Compare And Swap.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Structure that contains an int for atomic operations.