ATLAS Offline Software
Loading...
Searching...
No Matches
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< CallMutex > m_lock

Detailed Description

Definition at line 210 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 213 of file PoolSvc.h.

213 {
214 // lock the global mutex to gain exclusive access to the context mutexes vector
215 std::lock_guard<CallMutex> temp_lock( glob_mtx );
216 // lock the mutex for the given context ID for the lifetime of this object
217 m_lock = std::unique_lock< CallMutex >{ *ctx_mutexes[contextId] };
218 }
std::unique_lock< CallMutex > m_lock
Definition PoolSvc.h:211

◆ ~ContextLock()

PoolSvc::ContextLock::~ContextLock ( )
inline

Definition at line 219 of file PoolSvc.h.

219{ m_lock.unlock(); }

Member Data Documentation

◆ m_lock

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

Definition at line 211 of file PoolSvc.h.


The documentation for this class was generated from the following file: