KASKADE 7 development version
Public Member Functions | Static Public Member Functions | List of all members
Kaskade::GridLocking< Grid > Struct Template Reference

Grid locking information based on grid type. More...

#include <gridBasics.hh>

Detailed Description

template<class Grid>
struct Kaskade::GridLocking< Grid >

Grid locking information based on grid type.

Some Dune grids appear not to be thread-safe even for read operations. Based on the grid type, we provide this information and provide a mutex which can be used to lock individual calls to the grid interface.

Definition at line 83 of file gridBasics.hh.

Inheritance diagram for Kaskade::GridLocking< Grid >:

Public Member Functions

void lock ()
 
bool try_lock ()
 
void unlock ()
 

Static Public Member Functions

static GridLocking< Grid > & mutex ()
 Returns a globally unique lockable object that shall be used for locking access to operations on the grid. More...
 

Member Function Documentation

◆ lock()

template<class Grid >
void Kaskade::GridLocking< Grid >::lock ( )
inline

Definition at line 100 of file gridBasics.hh.

◆ mutex()

template<class Grid >
static GridLocking< Grid > & Kaskade::GridLocking< Grid >::mutex ( )
inlinestatic

Returns a globally unique lockable object that shall be used for locking access to operations on the grid.

For grids which are (supposed to be) thread-safe, this returns a dummy lockable, which does exactly nothing (as it should be). For non-safe grids this returns a recursive mutex. Thus, the grid access can be made mutually exclusive without caring whether a calling routine has already acquired the mutex.

Definition at line 94 of file gridBasics.hh.

◆ try_lock()

template<class Grid >
bool Kaskade::GridLocking< Grid >::try_lock ( )
inline

Definition at line 103 of file gridBasics.hh.

◆ unlock()

template<class Grid >
void Kaskade::GridLocking< Grid >::unlock ( )
inline

Definition at line 108 of file gridBasics.hh.


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