g2o
Loading...
Searching...
No Matches
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 63 of file openmp_mutex.h.

Constructor & Destructor Documentation

◆ OpenMPMutex()

g2o::OpenMPMutex::OpenMPMutex ( )
inline

Definition at line 68 of file openmp_mutex.h.

68: _cnt(0) {}

◆ ~OpenMPMutex()

g2o::OpenMPMutex::~OpenMPMutex ( )
inline

Definition at line 70 of file openmp_mutex.h.

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

References _cnt.

Member Function Documentation

◆ lock()

void g2o::OpenMPMutex::lock ( )
inline

Definition at line 71 of file openmp_mutex.h.

71{ assert(++_cnt == 1 && "Locking already locked mutex"); }

References _cnt.

Referenced by g2o::ScopedOpenMPMutex::ScopedOpenMPMutex().

◆ unlock()

void g2o::OpenMPMutex::unlock ( )
inline

Definition at line 72 of file openmp_mutex.h.

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

References _cnt.

Referenced by g2o::ScopedOpenMPMutex::~ScopedOpenMPMutex().

Member Data Documentation

◆ _cnt

char g2o::OpenMPMutex::_cnt
protected

Definition at line 78 of file openmp_mutex.h.

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


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