CACAO
Namespaces | Functions
md-atomic.hpp File Reference

Go to the source code of this file.

Namespaces

 Atomic_md
 

Functions

uint64_t compare_and_swap (volatile uint64_t *p, uint64_t oldval, uint64_t newval)
 An atomic compare and swap for 64-bit integer values. More...
 
void memory_barrier (void)
 A memory barrier. More...
 
void write_memory_barrier (void)
 A write memory barrier. More...
 
void instruction_barrier (void)
 An instruction barrier. More...
 

Function Documentation

uint64_t compare_and_swap ( volatile uint64_t *  p,
uint64_t  oldval,
uint64_t  newval 
)
inline

An atomic compare and swap for 64-bit integer values.

Parameters
pPointer to memory address.
oldvalOld value to be expected.
newvalNew value to be stored.
Returns
value of the memory location before the store

Definition at line 76 of file md-atomic.hpp.

void instruction_barrier ( void  )
inline

An instruction barrier.

Definition at line 111 of file md-atomic.hpp.

void memory_barrier ( void  )
inline

A memory barrier.

Definition at line 93 of file md-atomic.hpp.

void write_memory_barrier ( void  )
inline

A write memory barrier.

Definition at line 102 of file md-atomic.hpp.