#include "Brooks0254Module.hh" #include "Brooks0254Card.hh" #include "Brooks0254Par.hh" unsigned Brooks0254Module::bmDebFlag = 0; pthread_mutex_t Brooks0254Module::bmGlobMutex; pthread_mutexattr_t Brooks0254Module::bmGlobMtxAttr; int Brooks0254Module::bmDummyInt = Brooks0254Module::InitGlobalMutex(); // Copy operator Brooks0254Module& Brooks0254Module::operator=( Brooks0254Module& module ) { MtxLock scopeLock( bmMutex ); bmAddr = module.bmAddr; bmPort = module.GetPort(); return *this; } // Initiliaze global mutex int Brooks0254Module::InitGlobalMutex() { pthread_mutexattr_init( &bmGlobMtxAttr ); pthread_mutexattr_setpshared( &bmGlobMtxAttr, PTHREAD_PROCESS_PRIVATE ); pthread_mutex_init( &bmGlobMutex, &bmGlobMtxAttr ); return 0; } // Initiliaze mutex for individual objects void Brooks0254Module::InitMutex() { pthread_mutexattr_init( &bmMtxAttr ); pthread_mutexattr_setpshared( &bmMtxAttr, PTHREAD_PROCESS_PRIVATE ); pthread_mutex_init( &bmMutex, &bmMtxAttr ); return; } // Destroy mutex for individual objects void Brooks0254Module::CloseMutex() { pthread_mutex_destroy( &bmMutex ); pthread_mutexattr_destroy( &bmMtxAttr ); return; }