libMesh
Public Member Functions | Private Attributes | List of all members
libMesh::Threads::BoolAcquire Class Reference

We use a class to turn Threads::in_threads on and off, to be exception-safe. More...

#include <threads.h>

Public Member Functions

 BoolAcquire (bool &b)
 
 ~BoolAcquire ()
 

Private Attributes

bool & _b
 

Detailed Description

We use a class to turn Threads::in_threads on and off, to be exception-safe.

Definition at line 53 of file threads.h.

Constructor & Destructor Documentation

◆ BoolAcquire()

libMesh::Threads::BoolAcquire::BoolAcquire ( bool &  b)
inlineexplicit

Definition at line 57 of file threads.h.

References _b, and libMesh::libmesh_assert().

57 : _b(b) { libmesh_assert(!_b); _b = true; }
libmesh_assert(ctx)

◆ ~BoolAcquire()

libMesh::Threads::BoolAcquire::~BoolAcquire ( )
inline

Definition at line 59 of file threads.h.

References _b.

59 { libmesh_exceptionless_assert(_b); _b = false; }

Member Data Documentation

◆ _b

bool& libMesh::Threads::BoolAcquire::_b
private

Definition at line 61 of file threads.h.

Referenced by BoolAcquire(), and ~BoolAcquire().


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