CMS 3D CMS Logo

Public Member Functions | Public Attributes

LStoreFile::MutexWrapper Class Reference

#include <LStoreFile.h>

List of all members.

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 m_lock, and filterCSVwithJSON::target.

{
        m_lock = target;
        pthread_mutex_lock( m_lock ); // never fails
}
LStoreFile::MutexWrapper::~MutexWrapper ( )

Definition at line 363 of file LStoreFile.cc.

{
        int retval;
        if ( (retval = pthread_mutex_unlock( m_lock )) ) {
                // congrats. pthread_mutex_lock failed and we're in a destructor
                // I don't know what to do here
                // Then again, if the mutex is jammed, things are already boned
                // Cry for a second, then continue with life, I guess
        // melo

                char buf[1024];
                edm::LogError("LStoreFileError")
              << "LStoreFile couldn't unlock a mutex. Not good." 
                  << strerror_r( retval, buf, 1024 );
        }
}

Member Data Documentation

Definition at line 47 of file LStoreFile.h.

Referenced by MutexWrapper().