00001 // Copyright CERN 2012 - Developed in collaboration with GSI 00002 00003 #include <fesa-core/Utilities/SharedMutex.h> 00004 00005 #include <fesa-core/Exception/FesaException.h> 00006 00007 00008 namespace fesa 00009 { 00010 00016 SharedMutex::SharedMutex(void* pAdrMemory) : 00017 AbstractMutex() 00018 { 00019 lock_ = (pthread_mutex_t*) pAdrMemory; 00020 if (!lock_) 00021 { 00022 throw FesaException(__FILE__, __LINE__, FesaErrorCreatingMutex.c_str(), " (mapping it to memory block)"); 00023 } 00024 memoryOwner_= false; 00025 init(PTHREAD_PROCESS_SHARED); 00026 } 00027 00028 } // fesa