g2o
Public Member Functions | Protected Attributes | List of all members
g2o::OpenMPMutex Class Reference

#include <openmp_mutex.h>

Public Member Functions

 OpenMPMutex ()
 
 ~OpenMPMutex ()
 
void lock ()
 
void unlock ()
 

Protected Attributes

char _cnt
 

Detailed Description

Definition at line 62 of file openmp_mutex.h.

Constructor & Destructor Documentation

g2o::OpenMPMutex::OpenMPMutex ( )
inline

Definition at line 68 of file openmp_mutex.h.

68 : _cnt(0) {}
g2o::OpenMPMutex::~OpenMPMutex ( )
inline

Definition at line 70 of file openmp_mutex.h.

References _cnt.

70 { assert(_cnt == 0 && "Freeing locked mutex");}

Member Function Documentation

void g2o::OpenMPMutex::lock ( )
inline

Definition at line 71 of file openmp_mutex.h.

References _cnt.

71 { assert(++_cnt == 1 && "Locking already locked mutex");}
void g2o::OpenMPMutex::unlock ( )
inline

Definition at line 72 of file openmp_mutex.h.

References _cnt.

72 { assert(--_cnt == 0 && "Trying to unlock a mutex which is not locked");}

Member Data Documentation

char g2o::OpenMPMutex::_cnt
protected

Definition at line 75 of file openmp_mutex.h.

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


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