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< CallMutexm_lock

Detailed Description

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

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

◆ ~ContextLock()

PoolSvc::ContextLock::~ContextLock ( )
inline

Definition at line 216 of file PoolSvc.h.

216{ m_lock.unlock(); }

Member Data Documentation

◆ m_lock

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

Definition at line 208 of file PoolSvc.h.


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