ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
PoolSvc::ContextLock Class Reference
Collaboration diagram for PoolSvc::ContextLock:

Public Member Functions

 ContextLock (int contextId, CallMutex &glob_mtx, const std::vector< CallMutex * > &ctx_mutexes)
 
 ~ContextLock ()
 

Private Attributes

std::unique_lock< CallMutexm_lock
 

Detailed Description

Definition at line 206 of file PoolSvc.h.

Constructor & Destructor Documentation

◆ ContextLock()

PoolSvc::ContextLock::ContextLock ( int  contextId,
CallMutex glob_mtx,
const std::vector< CallMutex * > &  ctx_mutexes 
)
inline

Definition at line 209 of file PoolSvc.h.

209  {
210  // lock the global mutex to gain exclusive access to the context mutexes vector
211  std::lock_guard<CallMutex> temp_lock( glob_mtx );
212  // lock the mutex for the given context ID for the lifetime of this object
213  m_lock = std::unique_lock< CallMutex >{ *ctx_mutexes[contextId] };
214  }

◆ ~ContextLock()

PoolSvc::ContextLock::~ContextLock ( )
inline

Definition at line 215 of file PoolSvc.h.

215 { m_lock.unlock(); }

Member Data Documentation

◆ m_lock

std::unique_lock< CallMutex > PoolSvc::ContextLock::m_lock
private

Definition at line 207 of file PoolSvc.h.


The documentation for this class was generated from the following file:
PoolSvc::ContextLock::m_lock
std::unique_lock< CallMutex > m_lock
Definition: PoolSvc.h:207