Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
thread_sync.h File Reference

Functions and classes for process manipulation. More...

#include <geogram/basic/common.h>
#include <geogram/basic/numeric.h>
#include <geogram/basic/assert.h>
#include <geogram/basic/argused.h>
#include <vector>
#include <atomic>

Go to the source code of this file.

Classes

class  GEO::Process::BasicSpinLockArray
 An array of light-weight synchronisation primitives (spinlocks). More...
 
class  GEO::Process::CompactSpinLockArray
 An array of light-weight synchronisation primitives (spinlocks). More...
 

Namespaces

 GEO
 Global Vorpaline namespace.
 
 GEO::Process
 Abstraction layer for process management and multi-threading.
 

Macros

#define GEOGRAM_SPINLOCK_INIT   ATOMIC_FLAG_INIT
 

Typedefs

typedef std::atomic_flag GEO::Process::spinlock
 A lightweight synchronization structure. More...
 
typedef CompactSpinLockArray GEO::Process::SpinLockArray
 

Functions

void geo_pause ()
 executes the pause instruction More...
 
void GEO::Process::acquire_spinlock (volatile spinlock &x)
 Loops until x is available then reserves it. More...
 
void GEO::Process::release_spinlock (volatile spinlock &x)
 Makes x available to other threads. More...
 

Detailed Description

Functions and classes for process manipulation.

Definition in file thread_sync.h.

Macro Definition Documentation

◆ GEOGRAM_SPINLOCK_INIT

#define GEOGRAM_SPINLOCK_INIT   ATOMIC_FLAG_INIT

The initialization value of a spinlock.

Definition at line 141 of file thread_sync.h.

Function Documentation

◆ geo_pause()

void geo_pause ( )
inline

executes the pause instruction

should be called when a spinlock is spinning

Definition at line 75 of file thread_sync.h.