diff options
Diffstat (limited to 'ace/RMCast/RMCast_Copy_On_Write.i')
-rw-r--r-- | ace/RMCast/RMCast_Copy_On_Write.i | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/ace/RMCast/RMCast_Copy_On_Write.i b/ace/RMCast/RMCast_Copy_On_Write.i new file mode 100644 index 00000000000..c6e5099cda5 --- /dev/null +++ b/ace/RMCast/RMCast_Copy_On_Write.i @@ -0,0 +1,36 @@ +// $Id$ + +template<class COLLECTION, class ITERATOR> ACE_INLINE +ACE_RMCast_Copy_On_Write_Collection<COLLECTION,ITERATOR>:: + ACE_RMCast_Copy_On_Write_Collection (void) + : refcount_ (1) +{ +} + +// **************************************************************** + +template<class COLLECTION, class ITERATOR> ACE_INLINE +ACE_RMCast_Copy_On_Write_Read_Guard<COLLECTION,ITERATOR>:: + ACE_RMCast_Copy_On_Write_Read_Guard (ACE_SYNCH_MUTEX &m, + Collection*& collection_ref) + : collection (0) + , mutex_ (m) +{ + ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_); + this->collection = collection_ref; + this->collection->_incr_refcnt (); +} + +template<class COLLECTION, class ITERATOR> ACE_INLINE +ACE_RMCast_Copy_On_Write_Read_Guard<COLLECTION,ITERATOR>:: + ~ACE_RMCast_Copy_On_Write_Read_Guard (void) +{ + if (this->collection != 0) + { + ACE_GUARD (ACE_SYNCH_MUTEX, ace_mon, this->mutex_); + this->collection->_decr_refcnt (); + } +} + +// **************************************************************** + |