Miosix
2.0alpha1
|
#include "interfaces-impl/atomic_ops_impl.h"
Namespaces | |
miosix | |
Functions | |
int | miosix::atomicSwap (volatile int *p, int v) |
void | miosix::atomicAdd (volatile int *p, int incr) |
int | miosix::atomicAddExchange (volatile int *p, int incr) |
int | miosix::atomicCompareAndSwap (volatile int *p, int prev, int next) |
void * | miosix::atomicFetchAndIncrement (void *const volatile *p, int offset, int incr) |
This file contains various atomic operations useful for implementing lock-free algorithms.
For architectures without hardware support for these operations, they are emulated by disabling interrupts. Note that these functions should be safe to be called also with interrupts disabled, so implementations that disable interrupts should be careful not to accidentally re-enable them if these functions are called with interupts disabled.