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

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

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

Definition at line 153 of file threads_none.h.

153 {}
libMesh::Threads::recursive_mutex::recursive_mutex ( )

Definition at line 182 of file threads_pthread.h.

183  {
184  pthread_mutexattr_init(&attr);
185  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
186  pthread_mutex_init(&mutex, &attr);
187  }
libMesh::Threads::recursive_mutex::~recursive_mutex ( )

Definition at line 188 of file threads_pthread.h.

188 { pthread_mutex_destroy(&mutex); }

Member Function Documentation

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

Definition at line 190 of file threads_pthread.h.

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

190 { pthread_mutex_lock(&mutex); }
void libMesh::Threads::recursive_mutex::unlock ( )

Definition at line 191 of file threads_pthread.h.

191 { pthread_mutex_unlock(&mutex); }

Member Data Documentation

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

Definition at line 210 of file threads_pthread.h.

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

Definition at line 209 of file threads_pthread.h.


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