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

Recursive mutex. More...

#include <threads_none.h>

Classes

class  scoped_lock
 

Public Member Functions

 recursive_mutex ()
 
 recursive_mutex ()
 
 ~recursive_mutex ()
 
void lock ()
 
void unlock ()
 
void lock ()
 
void unlock ()
 

Private Attributes

pthread_mutex_t mutex
 
pthread_mutexattr_t attr
 
std::recursive_mutex _m
 

Detailed Description

Recursive mutex.

Implements mutual exclusion by busy-waiting in user space for the lock to be acquired.

Definition at line 166 of file threads_none.h.

Constructor & Destructor Documentation

◆ recursive_mutex() [1/2]

libMesh::Threads::recursive_mutex::recursive_mutex ( )
inline

Definition at line 169 of file threads_none.h.

169 {}

◆ recursive_mutex() [2/2]

libMesh::Threads::recursive_mutex::recursive_mutex ( )
inline

Definition at line 182 of file threads_pthread.h.

References attr, and mutex.

183  {
184  pthread_mutexattr_init(&attr);
185  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
186  pthread_mutex_init(&mutex, &attr);
187  }

◆ ~recursive_mutex()

libMesh::Threads::recursive_mutex::~recursive_mutex ( )
inline

Definition at line 188 of file threads_pthread.h.

References mutex.

188 { pthread_mutex_destroy(&mutex); }

Member Function Documentation

◆ lock() [1/2]

void libMesh::Threads::recursive_mutex::lock ( )
inline

◆ lock() [2/2]

void libMesh::Threads::recursive_mutex::lock ( )
inline

Definition at line 292 of file threads_tbb.h.

References _m.

292 { _m.lock(); }

◆ unlock() [1/2]

void libMesh::Threads::recursive_mutex::unlock ( )
inline

Definition at line 191 of file threads_pthread.h.

References mutex.

Referenced by libMesh::Threads::recursive_mutex::scoped_lock::release().

191 { pthread_mutex_unlock(&mutex); }

◆ unlock() [2/2]

void libMesh::Threads::recursive_mutex::unlock ( )
inline

Definition at line 293 of file threads_tbb.h.

References _m.

293 { _m.unlock(); }

Member Data Documentation

◆ _m

std::recursive_mutex libMesh::Threads::recursive_mutex::_m
private

Definition at line 310 of file threads_tbb.h.

Referenced by lock(), and unlock().

◆ attr

pthread_mutexattr_t libMesh::Threads::recursive_mutex::attr
private

Definition at line 210 of file threads_pthread.h.

Referenced by recursive_mutex().

◆ mutex

pthread_mutex_t libMesh::Threads::recursive_mutex::mutex
private

Definition at line 209 of file threads_pthread.h.

Referenced by lock(), recursive_mutex(), unlock(), and ~recursive_mutex().


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