1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// -*- C++ -*-
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
template<class COLLECTION, class ITERATOR> ACE_INLINE
TAO_ESF_Copy_On_Write_Collection<COLLECTION,ITERATOR>::
TAO_ESF_Copy_On_Write_Collection (void)
: refcount_ (1)
{
}
// ****************************************************************
template<class COLLECTION, class ITERATOR, class ACE_LOCK> ACE_INLINE
TAO_ESF_Copy_On_Write_Read_Guard<COLLECTION,ITERATOR,ACE_LOCK>::
TAO_ESF_Copy_On_Write_Read_Guard (ACE_LOCK &m,
Collection*& collection_ref)
: collection (0),
mutex (m)
{
ACE_GUARD (ACE_LOCK, ace_mon, this->mutex);
this->collection = collection_ref;
this->collection->_incr_refcnt ();
}
template<class COLLECTION, class ITERATOR, class ACE_LOCK> ACE_INLINE
TAO_ESF_Copy_On_Write_Read_Guard<COLLECTION,ITERATOR,ACE_LOCK>::
~TAO_ESF_Copy_On_Write_Read_Guard (void)
{
if (this->collection != 0)
{
ACE_GUARD (ACE_LOCK, ace_mon, this->mutex);
this->collection->_decr_refcnt ();
}
}
// ****************************************************************
TAO_END_VERSIONED_NAMESPACE_DECL
|