CMS 3D CMS Logo

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 357 of file LStoreFile.cc.

References edmPickEvents::target.

358 {
359  m_lock = target;
360  pthread_mutex_lock( m_lock ); // never fails
361 }
pthread_mutex_t * m_lock
Definition: LStoreFile.h:47
LStoreFile::MutexWrapper::~MutexWrapper ( )

Definition at line 363 of file LStoreFile.cc.

364 {
365  int retval;
366  if ( (retval = pthread_mutex_unlock( m_lock )) ) {
367  // congrats. pthread_mutex_lock failed and we're in a destructor
368  // I don't know what to do here
369  // Then again, if the mutex is jammed, things are already boned
370  // Cry for a second, then continue with life, I guess
371  // melo
372 
373  char buf[1024];
374  edm::LogError("LStoreFileError")
375  << "LStoreFile couldn't unlock a mutex. Not good."
376  << strerror_r( retval, buf, 1024 );
377  }
378 }
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.