CAS implementation using the gcc builtin.
More...
Go to the source code of this file.
Functions |
__inline__ int | cas (volatile unsigned int *ref, unsigned int exp, unsigned int val) |
| Compare and swap using gcc builtin.
|
Detailed Description
CAS implementation using the gcc builtin.
Function Documentation
__inline__ int cas |
( |
volatile unsigned int * |
ref, |
|
|
unsigned int |
exp, |
|
|
unsigned int |
val | |
|
) |
| | |
Compare and swap using gcc builtin.
This function uses the gcc builtin __sync_bool_compare_and_swap. See http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html for more details.
Note: extern inline forces GCC to always inline this function an to not generate a standalone version of the function.