libMesh::Threads::recursive_mutex Class Reference

#include <threads.h>

Classes

class  scoped_lock
 

Public Member Functions

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

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 397 of file threads.h.

Constructor & Destructor Documentation

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

Definition at line 401 of file threads.h.

References attr, and mutex.

402  {
403  pthread_mutexattr_init(&attr);
404  pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
405  pthread_mutex_init(&mutex, &attr);
406  }
libMesh::Threads::recursive_mutex::~recursive_mutex ( )
inline

Definition at line 407 of file threads.h.

References mutex.

407 { pthread_mutex_destroy(&mutex); }
libMesh::Threads::recursive_mutex::recursive_mutex ( )
inline

Definition at line 871 of file threads.h.

871 {}

Member Function Documentation

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

Definition at line 409 of file threads.h.

References mutex.

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

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

Definition at line 410 of file threads.h.

References mutex.

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

410 { pthread_mutex_unlock(&mutex); }

Member Data Documentation

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

Definition at line 429 of file threads.h.

Referenced by recursive_mutex().

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

Definition at line 428 of file threads.h.

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


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

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:33 UTC

Hosted By:
SourceForge.net Logo