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 34 of file LStoreFile.h.

Constructor & Destructor Documentation

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

Definition at line 284 of file LStoreFile.cc.

References filterCSVwithJSON::target.

284  {
285  m_lock = target;
286  pthread_mutex_lock(m_lock); // never fails
287 }
pthread_mutex_t * m_lock
Definition: LStoreFile.h:38
LStoreFile::MutexWrapper::~MutexWrapper ( )

Definition at line 289 of file LStoreFile.cc.

289  {
290  int retval;
291  if ((retval = pthread_mutex_unlock(m_lock))) {
292  // congrats. pthread_mutex_lock failed and we're in a destructor
293  // I don't know what to do here
294  // Then again, if the mutex is jammed, things are already boned
295  // Cry for a second, then continue with life, I guess
296  // melo
297 
298  char buf[1024];
299  edm::LogError("LStoreFileError") << "LStoreFile couldn't unlock a mutex. Not good."
300  << strerror_r(retval, buf, 1024);
301  }
302 }
pthread_mutex_t * m_lock
Definition: LStoreFile.h:38

Member Data Documentation

pthread_mutex_t* LStoreFile::MutexWrapper::m_lock

Definition at line 38 of file LStoreFile.h.