libMesh::Threads::spin_mutex Class Reference

#include <threads.h>

Classes

class  scoped_lock
 

Public Member Functions

 spin_mutex ()
 
 ~spin_mutex ()
 
void lock ()
 
void unlock ()
 
 spin_mutex ()
 
 ~spin_mutex ()
 
void lock ()
 
void unlock ()
 
 spin_mutex ()
 
void lock ()
 
void unlock ()
 

Private Attributes

OSSpinLock slock
 
pthread_spinlock_t slock
 

Detailed Description

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

Definition at line 334 of file threads.h.

Constructor & Destructor Documentation

libMesh::Threads::spin_mutex::spin_mutex ( )
inline

Definition at line 337 of file threads.h.

337 : slock(0) {} // The convention is that the lock being zero is _unlocked_
libMesh::Threads::spin_mutex::~spin_mutex ( )
inline

Definition at line 338 of file threads.h.

338 {}
libMesh::Threads::spin_mutex::spin_mutex ( )
inline

Definition at line 366 of file threads.h.

References slock.

366 { pthread_spin_init(&slock, PTHREAD_PROCESS_PRIVATE); }
libMesh::Threads::spin_mutex::~spin_mutex ( )
inline

Definition at line 367 of file threads.h.

References slock.

367 { pthread_spin_destroy(&slock); }
libMesh::Threads::spin_mutex::spin_mutex ( )
inline

Definition at line 849 of file threads.h.

849 {}

Member Function Documentation

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

Definition at line 340 of file threads.h.

References slock.

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

340 { OSSpinLockLock(&slock); }
void libMesh::Threads::spin_mutex::lock ( )
inline

Definition at line 369 of file threads.h.

References slock.

369 { pthread_spin_lock(&slock); }
void libMesh::Threads::spin_mutex::lock ( )
inline

Definition at line 850 of file threads.h.

850 {}
void libMesh::Threads::spin_mutex::unlock ( )
inline

Definition at line 341 of file threads.h.

References slock.

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

341 { OSSpinLockUnlock(&slock); }
void libMesh::Threads::spin_mutex::unlock ( )
inline

Definition at line 370 of file threads.h.

References slock.

370 { pthread_spin_unlock(&slock); }
void libMesh::Threads::spin_mutex::unlock ( )
inline

Definition at line 851 of file threads.h.

851 {}

Member Data Documentation

OSSpinLock libMesh::Threads::spin_mutex::slock
private

Definition at line 359 of file threads.h.

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

pthread_spinlock_t libMesh::Threads::spin_mutex::slock
private

Definition at line 388 of file threads.h.


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