ATLAS Offline Software
LockedAllocator.h
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id$
16 #include <mutex>
17 
18 
19 #ifndef ATHALLOCATORS_LOCKEDALLOCATOR_H
20 #define ATHALLOCATORS_LOCKEDALLOCATOR_H
21 
22 
23 namespace SG {
24 
25 
26 class ArenaAllocatorBase;
27 
28 
40 {
41 public:
48 
49 
54 
55 
60 
61 
66 
67 
71  const ArenaAllocatorBase* get() const;
72 
73 
74 private:
77 
79  std::unique_lock<std::mutex> m_lock;
80 };
81 
82 
83 } // namespace SG
84 
85 
87 
88 
89 #endif // not ATHALLOCATORS_LOCKEDALLOCATOR_H
SG::LockedAllocator::get
const ArenaAllocatorBase * get() const
Return the underlying pointer.
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
SG::LockedAllocator::operator->
ArenaAllocatorBase * operator->()
Dereference the pointer.
SG::LockedAllocator::m_lock
std::unique_lock< std::mutex > m_lock
The lock for the allocator.
Definition: LockedAllocator.h:79
SG::LockedAllocator::LockedAllocator
LockedAllocator(ArenaAllocatorBase *alloc, std::mutex &mutex)
Constructor.
SG::LockedAllocator::operator*
ArenaAllocatorBase & operator*()
Dereference the pointer.
SG::ArenaAllocatorBase
Common base class for arena allocator classes.
Definition: ArenaAllocatorBase.h:134
SG::LockedAllocator
A pointer type that holds a lock on an allocator object.
Definition: LockedAllocator.h:40
LockedAllocator.icc
SG::LockedAllocator::get
ArenaAllocatorBase * get()
Return the underlying pointer.
SG::LockedAllocator::m_alloc
ArenaAllocatorBase * m_alloc
The allocator to which we point.
Definition: LockedAllocator.h:76