CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
LStoreFile::MutexWrapper Class Reference

#include <LStoreFile.h>

Public Member Functions

 MutexWrapper (pthread_mutex_t *lock)
 
 ~MutexWrapper ()
 

Public Attributes

pthread_mutex_t * m_lock
 

Detailed Description

Definition at line 43 of file LStoreFile.h.

Constructor & Destructor Documentation

LStoreFile::MutexWrapper::MutexWrapper ( pthread_mutex_t *  lock)

Definition at line 334 of file LStoreFile.cc.

References m_lock, and filterCSVwithJSON::target.

335 {
336  m_lock = target;
337  pthread_mutex_lock( m_lock ); // never fails
338 }
pthread_mutex_t * m_lock
Definition: LStoreFile.h:47
LStoreFile::MutexWrapper::~MutexWrapper ( )

Definition at line 340 of file LStoreFile.cc.

341 {
342  int retval;
343  if ( (retval = pthread_mutex_unlock( m_lock )) ) {
344  // congrats. pthread_mutex_lock failed and we're in a destructor
345  // I don't know what to do here
346  // Then again, if the mutex is jammed, things are already boned
347  // Cry for a second, then continue with life, I guess
348  // melo
349 
350  char buf[1024];
351  edm::LogError("LStoreFileError")
352  << "LStoreFile couldn't unlock a mutex. Not good."
353  << strerror_r( retval, buf, 1024 );
354  }
355 }
pthread_mutex_t * m_lock
Definition: LStoreFile.h:47

Member Data Documentation

pthread_mutex_t* LStoreFile::MutexWrapper::m_lock

Definition at line 47 of file LStoreFile.h.

Referenced by MutexWrapper().