libMesh::Threads::recursive_mutex Class Reference

#include <threads_none.h>

Classes

class  scoped_lock
 

Public Member Functions

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

Private Attributes

pthread_mutex_t mutex
 
pthread_mutexattr_t attr
 

Detailed Description

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

Definition at line 150 of file threads_none.h.

Constructor & Destructor Documentation

◆ recursive_mutex() [1/2]

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

Definition at line 153 of file threads_none.h.

153 {}

◆ 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()

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

◆ unlock()

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); }

Member Data Documentation

◆ 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: