Zycore 1.5.1.0
Loading...
Searching...
No Matches
Classes | Macros | Typedefs
Atomic.h File Reference
#include <Zycore/Defines.h>
#include <Zycore/Types.h>
Include dependency graph for Atomic.h:

Go to the source code of this file.

Classes

struct  ZyanAtomic32_
 
struct  ZyanAtomic64_
 
struct  ZyanAtomicPointer_
 

Macros

#define ZYAN_ATOMIC_COMPARE_EXCHANGE(destination, comparand, value)    ZyanAtomicCompareExchange((ZyanAtomicPointer*)&(destination), (comparand), (value))
 
#define ZYAN_ATOMIC_INCREMENT(destination)    ZyanAtomicIncrement((ZyanAtomicPointer*)&(destination));
 
#define ZYAN_ATOMIC_DECREMENT(destination)    ZyanAtomicDecrement((ZyanAtomicPointer*)&(destination));
 
#define ZYAN_ATOMIC_COMPARE_EXCHANGE32(destination, comparand, value)    ZyanAtomicCompareExchange32((ZyanAtomic32*)&(destination), (comparand), (value))
 
#define ZYAN_ATOMIC_INCREMENT32(destination)    ZyanAtomicIncrement32((ZyanAtomic32*)&(destination));
 
#define ZYAN_ATOMIC_DECREMENT32(destination)    ZyanAtomicDecrement32((ZyanAtomic32*)&(destination));
 
#define ZYAN_ATOMIC_COMPARE_EXCHANGE64(destination, comparand, value)    ZyanAtomicCompareExchange64((ZyanAtomic64*)&(destination), (comparand), (value))
 
#define ZYAN_ATOMIC_INCREMENT64(destination)    ZyanAtomicIncrement64((ZyanAtomic64*)&(destination));
 
#define ZYAN_ATOMIC_DECREMENT64(destination)    ZyanAtomicDecrement64((ZyanAtomic64*)&(destination));
 

Typedefs

typedef struct ZyanAtomic32_ ZyanAtomic32
 
typedef struct ZyanAtomic64_ ZyanAtomic64
 
typedef struct ZyanAtomicPointer_ ZyanAtomicPointer
 

Detailed Description

Cross compiler atomic intrinsics.

Macro Definition Documentation

◆ ZYAN_ATOMIC_COMPARE_EXCHANGE

#define ZYAN_ATOMIC_COMPARE_EXCHANGE (   destination,
  comparand,
  value 
)     ZyanAtomicCompareExchange((ZyanAtomicPointer*)&(destination), (comparand), (value))

Compares two values for equality and, if they are equal, replaces the first value.

Parameters
destinationA pointer to the destination value.
comparandThe value to compare with.
valueThe replacement value.
Returns
The original value.

◆ ZYAN_ATOMIC_COMPARE_EXCHANGE32

#define ZYAN_ATOMIC_COMPARE_EXCHANGE32 (   destination,
  comparand,
  value 
)     ZyanAtomicCompareExchange32((ZyanAtomic32*)&(destination), (comparand), (value))

Compares two values for equality and, if they are equal, replaces the first value.

Parameters
destinationA pointer to the destination value.
comparandThe value to compare with.
valueThe replacement value.
Returns
The original value.

◆ ZYAN_ATOMIC_COMPARE_EXCHANGE64

#define ZYAN_ATOMIC_COMPARE_EXCHANGE64 (   destination,
  comparand,
  value 
)     ZyanAtomicCompareExchange64((ZyanAtomic64*)&(destination), (comparand), (value))

Compares two values for equality and, if they are equal, replaces the first value.

Parameters
destinationA pointer to the destination value.
comparandThe value to compare with.
valueThe replacement value.
Returns
The original value.

◆ ZYAN_ATOMIC_DECREMENT

#define ZYAN_ATOMIC_DECREMENT (   destination)     ZyanAtomicDecrement((ZyanAtomicPointer*)&(destination));

Decrements the given value and stores the result, as an atomic operation.

Parameters
destinationA pointer to the destination value.
Returns
The decremented value.

◆ ZYAN_ATOMIC_DECREMENT32

#define ZYAN_ATOMIC_DECREMENT32 (   destination)     ZyanAtomicDecrement32((ZyanAtomic32*)&(destination));

Decrements the given value and stores the result, as an atomic operation.

Parameters
destinationA pointer to the destination value.
Returns
The decremented value.

◆ ZYAN_ATOMIC_DECREMENT64

#define ZYAN_ATOMIC_DECREMENT64 (   destination)     ZyanAtomicDecrement64((ZyanAtomic64*)&(destination));

Decrements the given value and stores the result, as an atomic operation.

Parameters
destinationA pointer to the destination value.
Returns
The decremented value.

◆ ZYAN_ATOMIC_INCREMENT

#define ZYAN_ATOMIC_INCREMENT (   destination)     ZyanAtomicIncrement((ZyanAtomicPointer*)&(destination));

Increments the given value and stores the result, as an atomic operation.

Parameters
destinationA pointer to the destination value.
Returns
The incremented value.

◆ ZYAN_ATOMIC_INCREMENT32

#define ZYAN_ATOMIC_INCREMENT32 (   destination)     ZyanAtomicIncrement32((ZyanAtomic32*)&(destination));

Increments the given value and stores the result, as an atomic operation.

Parameters
destinationA pointer to the destination value.
Returns
The incremented value.

◆ ZYAN_ATOMIC_INCREMENT64

#define ZYAN_ATOMIC_INCREMENT64 (   destination)     ZyanAtomicIncrement64((ZyanAtomic64*)&(destination));

Increments the given value and stores the result, as an atomic operation.

Parameters
destinationA pointer to the destination value.
Returns
The incremented value.