Geogram Version 1.8.5
A programming library of geometric algorithms
Loading...
Searching...
No Matches
atomics.h File Reference

Functions for atomic operations. More...

Go to the source code of this file.

Functions

void geo_pause ()
 Issues a processor pause (INTEL only)
 
char atomic_bittestandset_x86 (volatile unsigned int *ptr, unsigned int bit)
 Atomically tests and sets a bit (INTEL only)
 
char atomic_bittestandreset_x86 (volatile unsigned int *ptr, unsigned int bit)
 Atomically tests and resets a bit (INTEL only)
 

Detailed Description

Functions for atomic operations.

Definition in file atomics.h.

Macro Definition Documentation

◆ GEO_USE_X86_ATOMICS

#define GEO_USE_X86_ATOMICS

Definition at line 59 of file atomics.h.

◆ GEO_USE_X86_PAUSE

#define GEO_USE_X86_PAUSE

Definition at line 236 of file atomics.h.

Function Documentation

◆ atomic_bittestandreset_x86()

char atomic_bittestandreset_x86 ( volatile unsigned int *  ptr,
unsigned int  bit 
)
inline

Atomically tests and resets a bit (INTEL only)

Resets bit bit of *ptr and returns its previous value. The function is atomic and acts as a read-write memory barrier

Parameters
[in]ptra pointer to an unsigned integer
[in]bitindex of the bit to reset in ptr
Returns
the previous value of bit bit

Definition at line 298 of file atomics.h.

◆ atomic_bittestandset_x86()

char atomic_bittestandset_x86 ( volatile unsigned int *  ptr,
unsigned int  bit 
)
inline

Atomically tests and sets a bit (INTEL only)

Sets bit bit of *ptr and returns its previous value. The function is atomic and acts as a read-write memory barrier.

Parameters
[in]ptra pointer to an unsigned integer
[in]bitindex of the bit to set in *ptr
Returns
the previous value of bit bit

Definition at line 266 of file atomics.h.

◆ geo_pause()

void geo_pause ( )
inline

Issues a processor pause (INTEL only)

Definition at line 243 of file atomics.h.