S2OPC OPCUA Toolkit
Functions
sopc_atomic.h File Reference

A platform independent API for atomic integer operations. More...

#include <stdint.h>

Go to the source code of this file.

Functions

int32_t SOPC_Atomic_Int_Get (int32_t *atomic)
 Returns the current value of an atomic integer variable. More...
 
void SOPC_Atomic_Int_Set (int32_t *atomic, int32_t val)
 Sets the value of an atomic integer variable. More...
 
int32_t SOPC_Atomic_Int_Add (int32_t *atomic, int32_t val)
 Adds a value to an atomic integer variable. More...
 
void * SOPC_Atomic_Ptr_Get (void **atomic)
 Returns the current value of an atomic pointer. More...
 
void SOPC_Atomic_Ptr_Set (void **atomic, void *val)
 Sets the value of an atomic pointer variable. More...
 

Detailed Description

A platform independent API for atomic integer operations.

Function Documentation

◆ SOPC_Atomic_Int_Get()

int32_t SOPC_Atomic_Int_Get ( int32_t *  atomic)

Returns the current value of an atomic integer variable.

Parameters
atomicThe address of the atomic variable.
Returns
The current value of the variable.

◆ SOPC_Atomic_Int_Set()

void SOPC_Atomic_Int_Set ( int32_t *  atomic,
int32_t  val 
)

Sets the value of an atomic integer variable.

Parameters
atomicThe address of the atomic variable.
valThe new value of the variable.

◆ SOPC_Atomic_Int_Add()

int32_t SOPC_Atomic_Int_Add ( int32_t *  atomic,
int32_t  val 
)

Adds a value to an atomic integer variable.

Parameters
atomicThe address of the atomic variable.
valThe value to add to the variable.
Returns
The old value (before the add) of the atomic variable.

◆ SOPC_Atomic_Ptr_Get()

void* SOPC_Atomic_Ptr_Get ( void **  atomic)

Returns the current value of an atomic pointer.

Parameters
atomicThe address of the atomic pointer.
Returns
The current value of the pointer.

◆ SOPC_Atomic_Ptr_Set()

void SOPC_Atomic_Ptr_Set ( void **  atomic,
void *  val 
)

Sets the value of an atomic pointer variable.

Parameters
atomicThe address of the atomic pointer.
valThe new value of the pointer.