OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
cub::Mutex Struct Reference

Detailed Description

Simple portable mutex

  • Wraps std::mutex when compiled with C++11 or newer (supported on all platforms)
  • Uses GNU/Windows spinlock mechanisms for pre C++11 (supported on x86/x64 when compiled with cl.exe or g++)

Definition at line 72 of file mutex.cuh.

Public Types

typedef int Spinlock

Public Member Functions

__forceinline__ void _ReadWriteBarrier ()
__forceinline__ long _InterlockedExchange (volatile int *const Target, const int Value)
__forceinline__ void YieldProcessor ()
 Mutex ()
__forceinline__ void Lock ()
__forceinline__ void Unlock ()

Data Fields

volatile Spinlock lock
 Lock member.

Constructor & Destructor Documentation

◆ Mutex()

cub::Mutex::Mutex ( )


Definition at line 138 of file mutex.cuh.

Member Function Documentation

◆ _InterlockedExchange()

__forceinline__ long cub::Mutex::_InterlockedExchange ( volatile int *const  Target,
const int  Value 

Atomic exchange

Definition at line 116 of file mutex.cuh.

◆ _ReadWriteBarrier()

__forceinline__ void cub::Mutex::_ReadWriteBarrier ( )

Compiler read/write barrier

Definition at line 108 of file mutex.cuh.

◆ Lock()

__forceinline__ void cub::Mutex::Lock ( )

Return when the specified spinlock has been acquired

Definition at line 143 of file mutex.cuh.

◆ Unlock()

__forceinline__ void cub::Mutex::Unlock ( )

Release the specified spinlock

Definition at line 156 of file mutex.cuh.

◆ YieldProcessor()

__forceinline__ void cub::Mutex::YieldProcessor ( )

Pause instruction to prevent excess processor bus usage

Definition at line 126 of file mutex.cuh.

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