From 9850a451909b077ed7fa108428338be3fb3c9d68 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 8 May 2002 22:50:12 +0000 Subject: [PATCH] allow assignment --- src/libCom/cxxTemplates/epicsGuard.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/libCom/cxxTemplates/epicsGuard.h b/src/libCom/cxxTemplates/epicsGuard.h index 3d39980be..21013f822 100644 --- a/src/libCom/cxxTemplates/epicsGuard.h +++ b/src/libCom/cxxTemplates/epicsGuard.h @@ -17,12 +17,12 @@ template < class T > class epicsGuard { public: epicsGuard ( T & ); + epicsGuard ( const epicsGuard & ); ~epicsGuard (); private: T & targetMutex; - friend class epicsGuardRelease < T >; - // epicsGuard ( const epicsGuard & ); visual c++ warning bug // epicsGuard & operator = ( const epicsGuard & ); visual c++ warning bug + friend class epicsGuardRelease < T >; }; // Automatically releases and reapplies the mutex. @@ -54,6 +54,13 @@ inline epicsGuard < T > :: epicsGuard ( T & mutexIn ) : this->targetMutex.lock (); } +template < class T > +epicsGuard < T > :: epicsGuard ( const epicsGuard & guardIn ) : + targetMutex ( guardIn.targetMutex ) +{ + this->targetMutex.lock (); +} + template < class T > inline epicsGuard < T > :: ~epicsGuard () {