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

◆ MutexWrapper()

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

Definition at line 284 of file LStoreFile.cc.

284  {
285  m_lock = target;
286  pthread_mutex_lock(m_lock); // never fails
287 }

References m_lock, and filterCSVwithJSON::target.

◆ ~MutexWrapper()

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 }

References visDQMUpload::buf.

Member Data Documentation

◆ m_lock

pthread_mutex_t* LStoreFile::MutexWrapper::m_lock

Definition at line 38 of file LStoreFile.h.

Referenced by MutexWrapper().

LStoreFile::MutexWrapper::m_lock
pthread_mutex_t * m_lock
Definition: LStoreFile.h:38
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
visDQMUpload.buf
buf
Definition: visDQMUpload.py:160
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32