Nebula
Loading...
Searching...
No Matches
Gcc::GccInterlocked Class Reference

#include <interlocked.h>

Detailed Description

Provides simple atomic operations on shared variables using gcc compiler builtins.

(C) 2013-2023 Individual contributors, see AUTHORS file

Static Public Member Functions

static int Increment (int volatile *var)
 interlocked increment
 
static int Decrement (int volatile *var)
 interlocked decrement
 
static long Increment (long volatile *var)
 interlocked increment, return result
 
static long Decrement (long volatile *var)
 interlocked decrement, return result
 
static int Add (int volatile *var, int add)
 interlocked add
 
static int Or (int volatile *var, int value)
 interlocked or
 
static int And (int volatile *var, int value)
 interlocked and
 
static int Xor (int volatile *var, int value)
 interlocked xor
 
static int Exchange (int volatile *dest, int value)
 interlocked exchange
 
static void * ExchangePointer (void *volatile *dest, void *value)
 interlocked exchange
 
static int CompareExchange (int volatile *dest, int exchange, int comparand)
 interlocked compare-exchange
 
static void * CompareExchangePointer (void *volatile *dest, void *exchange, void *comparand)
 interlocked exchange
 

Member Function Documentation

◆ Add()

int Gcc::GccInterlocked::Add ( int volatile * var,
int add )
inlinestatic

interlocked add

◆ And()

int Gcc::GccInterlocked::And ( int volatile * var,
int value )
inlinestatic

interlocked and

◆ CompareExchange()

int Gcc::GccInterlocked::CompareExchange ( int volatile * dest,
int exchange,
int comparand )
inlinestatic

interlocked compare-exchange

◆ CompareExchangePointer()

void * Gcc::GccInterlocked::CompareExchangePointer ( void *volatile * dest,
void * exchange,
void * comparand )
inlinestatic

interlocked exchange

◆ Decrement() [1/2]

int Gcc::GccInterlocked::Decrement ( int volatile * var)
inlinestatic

interlocked decrement

◆ Decrement() [2/2]

long Gcc::GccInterlocked::Decrement ( long volatile * var)
inlinestatic

interlocked decrement, return result

◆ Exchange()

int Gcc::GccInterlocked::Exchange ( int volatile * dest,
int value )
inlinestatic

interlocked exchange

◆ ExchangePointer()

void * Gcc::GccInterlocked::ExchangePointer ( void *volatile * dest,
void * value )
inlinestatic

interlocked exchange

◆ Increment() [1/2]

int Gcc::GccInterlocked::Increment ( int volatile * var)
inlinestatic

interlocked increment

◆ Increment() [2/2]

long Gcc::GccInterlocked::Increment ( long volatile * var)
inlinestatic

interlocked increment, return result

◆ Or()

int Gcc::GccInterlocked::Or ( int volatile * var,
int value )
inlinestatic

interlocked or

◆ Xor()

int Gcc::GccInterlocked::Xor ( int volatile * var,
int value )
inlinestatic

interlocked xor


The documentation for this class was generated from the following file: