ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
AthContainers_detail::upgrading_lock< LOCKABLE > Class Template Reference

Lock object for taking out upgradable locks. More...

#include <threading.h>

Collaboration diagram for AthContainers_detail::upgrading_lock< LOCKABLE >:

Public Types

typedef LOCKABLE lockable_type
 The underlying object type. More...
 

Public Member Functions

 upgrading_lock (lockable_type &obj)
 Take out an upgrade lock on obj and remember it. More...
 
 ~upgrading_lock ()
 Release the held lock. More...
 
void upgrade ()
 Convert the lock from upgrade to exclusive. More...
 

Private Member Functions

 upgrading_lock ()
 
 upgrading_lock (upgrading_lock const &)
 
upgrading_lockoperator= (upgrading_lock const &)
 

Private Attributes

lockable_typem_obj
 The lock being held. More...
 
bool m_exclusive
 Has the lock been converted to exclusive? More...
 

Detailed Description

template<class LOCKABLE>
class AthContainers_detail::upgrading_lock< LOCKABLE >

Lock object for taking out upgradable locks.

The will first be taken out in upgrade mode. If upgrade() is called, then the lock will be upgraded to exclusive mode. When this object is destroyed, the object will be unlocked for either upgrade or exclusive mode, as appropriate.

Definition at line 228 of file threading.h.

Member Typedef Documentation

◆ lockable_type

template<class LOCKABLE >
typedef LOCKABLE AthContainers_detail::upgrading_lock< LOCKABLE >::lockable_type

The underlying object type.

Definition at line 232 of file threading.h.

Constructor & Destructor Documentation

◆ upgrading_lock() [1/3]

template<class LOCKABLE >
AthContainers_detail::upgrading_lock< LOCKABLE >::upgrading_lock ( lockable_type obj)
explicit

Take out an upgrade lock on obj and remember it.

Parameters
objThe lockable object.

◆ ~upgrading_lock()

template<class LOCKABLE >
AthContainers_detail::upgrading_lock< LOCKABLE >::~upgrading_lock ( )

Release the held lock.

◆ upgrading_lock() [2/3]

template<class LOCKABLE >
AthContainers_detail::upgrading_lock< LOCKABLE >::upgrading_lock ( )
private

◆ upgrading_lock() [3/3]

template<class LOCKABLE >
AthContainers_detail::upgrading_lock< LOCKABLE >::upgrading_lock ( upgrading_lock< LOCKABLE > const )
private

Member Function Documentation

◆ operator=()

template<class LOCKABLE >
upgrading_lock& AthContainers_detail::upgrading_lock< LOCKABLE >::operator= ( upgrading_lock< LOCKABLE > const )
private

◆ upgrade()

template<class LOCKABLE >
void AthContainers_detail::upgrading_lock< LOCKABLE >::upgrade ( )

Convert the lock from upgrade to exclusive.

Member Data Documentation

◆ m_exclusive

template<class LOCKABLE >
bool AthContainers_detail::upgrading_lock< LOCKABLE >::m_exclusive
private

Has the lock been converted to exclusive?

Definition at line 266 of file threading.h.

◆ m_obj

template<class LOCKABLE >
lockable_type& AthContainers_detail::upgrading_lock< LOCKABLE >::m_obj
private

The lock being held.

Definition at line 263 of file threading.h.


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