From 921db3d9f8366f17a338a42afd4d9738b22088b7 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 6 Feb 2002 02:27:42 +0000 Subject: [PATCH] make copy constructor and assignment oper private --- src/ca/autoPtrRecycle.h | 2 ++ src/ca/bhe.h | 2 ++ src/ca/cac.h | 5 +++++ src/ca/cacIO.h | 7 ++++++- src/ca/cacServiceList.cpp | 4 ++++ src/ca/comQueRecv.h | 2 ++ src/ca/comQueSend.h | 2 ++ src/ca/msgForMultiplyDefinedPV.h | 2 ++ src/ca/netIO.h | 9 +++++++++ src/ca/netiiu.h | 5 +++++ src/ca/oldAccess.h | 12 ++++++++++++ src/ca/repeaterSubscribeTimer.h | 2 ++ src/ca/searchTimer.h | 2 ++ src/ca/syncGroup.h | 14 ++++++++++++-- src/ca/tcpRecvWatchdog.h | 2 ++ src/ca/tcpSendWatchdog.h | 2 ++ src/ca/udpiiu.h | 3 +++ src/ca/virtualCircuit.h | 3 +++ src/db/dbCAC.h | 13 +++++++++++++ src/db/dbServiceIO.cpp | 4 ++++ src/libCom/fdmgr/fdManager.cpp | 14 -------------- src/libCom/fdmgr/fdManager.h | 12 +++++++----- src/libCom/fdmgr/fdmgr.cpp | 9 +++++++-- src/libCom/misc/ipAddrToAsciiAsynchronous.h | 2 ++ src/libCom/osi/epicsMutex.h | 11 ++++------- src/libCom/timer/timerPrivate.h | 13 +++++++++++++ src/libCom/timer/timerQueueActiveMgr.cpp | 4 ++++ 27 files changed, 131 insertions(+), 31 deletions(-) diff --git a/src/ca/autoPtrRecycle.h b/src/ca/autoPtrRecycle.h index 73160af2c..862df896f 100644 --- a/src/ca/autoPtrRecycle.h +++ b/src/ca/autoPtrRecycle.h @@ -33,6 +33,8 @@ private: cacRecycle &r; tsDLList < class baseNMIU > &eventq; chronIntIdResTable < baseNMIU > &ioTable; + autoPtrRecycle ( const autoPtrRecycle & ); + autoPtrRecycle & operator = ( const autoPtrRecycle & ); }; template < class T > diff --git a/src/ca/bhe.h b/src/ca/bhe.h index 1f679e7f5..95ea8be4e 100644 --- a/src/ca/bhe.h +++ b/src/ca/bhe.h @@ -58,6 +58,8 @@ private: void beaconAnomalyNotify (); static tsFreeList < class bhe, 1024 > freeList; static epicsMutex freeListMutex; + bhe ( const bhe & ); + bhe & operator = ( const bhe & ); }; /* diff --git a/src/ca/cac.h b/src/ca/cac.h index 18128a2e9..4f7ad6b11 100644 --- a/src/ca/cac.h +++ b/src/ca/cac.h @@ -259,6 +259,9 @@ private: static const pExcepProtoStubTCP tcpExcepJumpTableCAC []; friend class callbackAutoMutex; + + cac ( const cac & ); + cac & operator = ( const cac & ); }; class callbackAutoMutex { @@ -267,6 +270,8 @@ public: ~callbackAutoMutex (); private: cac & ctx; + callbackAutoMutex ( const callbackAutoMutex & ); + callbackAutoMutex & operator = ( const callbackAutoMutex & ); }; inline const char * cac::userNamePointer () const diff --git a/src/ca/cacIO.h b/src/ca/cacIO.h index 6238b6ebe..aa9c2ca25 100644 --- a/src/ca/cacIO.h +++ b/src/ca/cacIO.h @@ -179,6 +179,8 @@ public: private: cacChannelNotify & callback; + cacChannel ( const cacChannel & ); + cacChannel & operator = ( const cacChannel & ); }; class cacNotify { // X aCC 655 @@ -205,6 +207,7 @@ public: class cacServiceList { public: + cacServiceList (); epicsShareFunc void registerService ( cacService &service ); epicsShareFunc cacChannel * createChannel ( const char *pName, cacChannelNotify &, @@ -213,11 +216,13 @@ public: private: tsDLList < cacService > services; mutable epicsMutex mutex; + cacServiceList ( const cacServiceList & ); + cacServiceList & operator = ( const cacServiceList & ); }; epicsShareExtern cacServiceList cacGlobalServiceList; -epicsShareFunc int epicsShareAPI ca_register_service ( struct cacService *pService ); +epicsShareFunc int epicsShareAPI ca_register_service ( cacService *pService ); inline cacChannel::cacChannel ( cacChannelNotify & notify ) : callback ( notify ) diff --git a/src/ca/cacServiceList.cpp b/src/ca/cacServiceList.cpp index 8e956e63f..afe4f78ff 100644 --- a/src/ca/cacServiceList.cpp +++ b/src/ca/cacServiceList.cpp @@ -22,6 +22,10 @@ epicsShareDef cacServiceList cacGlobalServiceList; +cacServiceList::cacServiceList () +{ +} + void cacServiceList::registerService ( cacService &service ) { epicsAutoMutex locker ( this->mutex ); diff --git a/src/ca/comQueRecv.h b/src/ca/comQueRecv.h index 23cf5e9b2..c407f1cf7 100644 --- a/src/ca/comQueRecv.h +++ b/src/ca/comQueRecv.h @@ -40,6 +40,8 @@ public: private: tsDLList < comBuf > bufs; unsigned nBytesPending; + comQueRecv ( const comQueRecv & ); + comQueRecv & operator = ( const comQueRecv & ); }; inline unsigned comQueRecv::occupiedBytes () const diff --git a/src/ca/comQueSend.h b/src/ca/comQueSend.h index a95c275c5..9a75b1fe8 100644 --- a/src/ca/comQueSend.h +++ b/src/ca/comQueSend.h @@ -114,6 +114,8 @@ private: } return; } + comQueSend ( const comQueSend & ); + comQueSend & operator = ( const comQueSend & ); }; inline bool comQueSend::dbr_type_ok ( unsigned type ) diff --git a/src/ca/msgForMultiplyDefinedPV.h b/src/ca/msgForMultiplyDefinedPV.h index 348511baa..7899ee2a7 100644 --- a/src/ca/msgForMultiplyDefinedPV.h +++ b/src/ca/msgForMultiplyDefinedPV.h @@ -39,6 +39,8 @@ private: cac &cacRef; static tsFreeList < class msgForMultiplyDefinedPV, 16 > freeList; static epicsMutex freeListMutex; + msgForMultiplyDefinedPV ( const msgForMultiplyDefinedPV & ); + msgForMultiplyDefinedPV & operator = ( const msgForMultiplyDefinedPV & ); }; inline void * msgForMultiplyDefinedPV::operator new ( size_t size ) diff --git a/src/ca/netIO.h b/src/ca/netIO.h index fa91bbaf8..0de14b0fd 100644 --- a/src/ca/netIO.h +++ b/src/ca/netIO.h @@ -44,6 +44,9 @@ protected: // notify // nciu & chan; +private: + baseNMIU ( const baseNMIU & ); + baseNMIU & operator = ( const baseNMIU & ); }; class netSubscription : public baseNMIU { @@ -81,6 +84,8 @@ private: void operator delete ( void *, size_t, tsFreeList < class netSubscription, 1024 > & ); # endif + netSubscription ( const netSubscription & ); + netSubscription & operator = ( const netSubscription & ); }; class netReadNotifyIO : public baseNMIU { @@ -107,6 +112,8 @@ private: void operator delete ( void *, size_t, tsFreeList < class netReadNotifyIO, 1024 > & ); # endif + netReadNotifyIO ( const netReadNotifyIO & ); + netReadNotifyIO & operator = ( const netReadNotifyIO & ); }; class netWriteNotifyIO : public baseNMIU { @@ -133,6 +140,8 @@ private: void operator delete ( void *, size_t, tsFreeList < class netWriteNotifyIO, 1024 > & ); # endif + netWriteNotifyIO ( const netWriteNotifyIO & ); + netWriteNotifyIO & operator = ( const netWriteNotifyIO & ); }; inline ca_uint32_t baseNMIU::getID () const diff --git a/src/ca/netiiu.h b/src/ca/netiiu.h index 6f95df38b..63628a06f 100644 --- a/src/ca/netiiu.h +++ b/src/ca/netiiu.h @@ -65,11 +65,16 @@ private: tsDLList < nciu > channelList; cac *pClientCtx; virtual void lastChannelDetachNotify (); + netiiu ( const netiiu & ); + netiiu & operator = ( const netiiu & ); }; class limboiiu : public netiiu { // X aCC 655 public: limboiiu (); +private: + limboiiu ( const limboiiu & ); + limboiiu & operator = ( const limboiiu & ); }; extern limboiiu limboIIU; diff --git a/src/ca/oldAccess.h b/src/ca/oldAccess.h index 67671d484..c5651c20b 100644 --- a/src/ca/oldAccess.h +++ b/src/ca/oldAccess.h @@ -89,6 +89,8 @@ private: bool includeFirstConnectInCountOfOutstandingIO () const; static tsFreeList < struct oldChannelNotify, 1024 > freeList; static epicsMutex freeListMutex; + oldChannelNotify ( const oldChannelNotify & ); + oldChannelNotify & operator = ( const oldChannelNotify & ); }; class getCopy : public cacReadNotify { @@ -115,6 +117,8 @@ private: const char *pContext, unsigned type, arrayElementCount count ); static tsFreeList < class getCopy, 1024 > freeList; static epicsMutex freeListMutex; + getCopy ( const getCopy & ); + getCopy & operator = ( const getCopy & ); }; class getCallback : public cacReadNotify { @@ -136,6 +140,8 @@ private: const char *pContext, unsigned type, arrayElementCount count ); static tsFreeList < class getCallback, 1024 > freeList; static epicsMutex freeListMutex; + getCallback ( const getCallback & ); + getCallback & operator = ( const getCallback & ); }; class putCallback : public cacWriteNotify { @@ -156,6 +162,8 @@ private: unsigned type, arrayElementCount count ); static tsFreeList < class putCallback, 1024 > freeList; static epicsMutex freeListMutex; + putCallback ( const putCallback & ); + putCallback & operator = ( const putCallback & ); }; struct oldSubscription : public cacStateNotify { @@ -181,6 +189,8 @@ private: const char *pContext, unsigned type, arrayElementCount count ); static tsFreeList < struct oldSubscription, 1024 > freeList; static epicsMutex freeListMutex; + oldSubscription ( const oldSubscription & ); + oldSubscription & operator = ( const oldSubscription & ); }; struct oldCAC : public cacNotify @@ -231,6 +241,8 @@ private: void fdWasCreated ( int fd ); void fdWasDestroyed ( int fd ); void attachToClientCtx (); + oldCAC ( const oldCAC & ); + oldCAC & operator = ( const oldCAC & ); }; int fetchClientContext ( oldCAC **ppcac ); diff --git a/src/ca/repeaterSubscribeTimer.h b/src/ca/repeaterSubscribeTimer.h index 28b59a86d..a3cd44299 100644 --- a/src/ca/repeaterSubscribeTimer.h +++ b/src/ca/repeaterSubscribeTimer.h @@ -35,6 +35,8 @@ private: bool registered; bool once; expireStatus expire ( const epicsTime & currentTime ); + repeaterSubscribeTimer ( const repeaterSubscribeTimer & ); + repeaterSubscribeTimer & operator = ( const repeaterSubscribeTimer & ); }; #endif // ifdef repeaterSubscribeTimerh diff --git a/src/ca/searchTimer.h b/src/ca/searchTimer.h index e9dcb6e4e..2ef6e4e92 100644 --- a/src/ca/searchTimer.h +++ b/src/ca/searchTimer.h @@ -51,6 +51,8 @@ private: bool noDelay; expireStatus expire ( const epicsTime & currentTime ); void setRetryInterval ( unsigned retryNo ); + searchTimer ( const searchTimer & ); + searchTimer & operator = ( const searchTimer & ); }; #endif // ifdef searchTimerh diff --git a/src/ca/syncGroup.h b/src/ca/syncGroup.h index a9e7fbaf6..3c22f8c53 100644 --- a/src/ca/syncGroup.h +++ b/src/ca/syncGroup.h @@ -50,7 +50,9 @@ protected: const unsigned magic; cacChannel::ioid id; bool idIsValid; - virtual ~syncGroupNotify (); + virtual ~syncGroupNotify (); + syncGroupNotify ( const syncGroupNotify & ); + syncGroupNotify & operator = ( const syncGroupNotify & ); }; class syncGroupReadNotify : public syncGroupNotify, public cacReadNotify { @@ -76,6 +78,8 @@ private: unsigned type, arrayElementCount count, const void *pData ); void exception ( int status, const char *pContext, unsigned type, arrayElementCount count ); + syncGroupReadNotify ( const syncGroupReadNotify & ); + syncGroupReadNotify & operator = ( const syncGroupReadNotify & ); }; class syncGroupWriteNotify : public syncGroupNotify, public cacWriteNotify { @@ -99,7 +103,10 @@ private: tsFreeList < class syncGroupWriteNotify, 128 > & ); # endif void completion (); - void exception ( int status, const char *pContext, unsigned type, arrayElementCount count ); + void exception ( int status, const char *pContext, + unsigned type, arrayElementCount count ); + syncGroupWriteNotify ( const syncGroupWriteNotify & ); + syncGroupWriteNotify & operator = ( const syncGroupWriteNotify & ); }; struct oldCAC; @@ -143,6 +150,9 @@ private: void destroyPendingIO ( syncGroupNotify * ); void destroyCompletedIO (); void destroyPendingIO (); + + CASG ( const CASG & ); + CASG & operator = ( const CASG & ); }; inline bool syncGroupNotify::ioInitiated () const diff --git a/src/ca/tcpRecvWatchdog.h b/src/ca/tcpRecvWatchdog.h index 98b1b95fe..289457674 100644 --- a/src/ca/tcpRecvWatchdog.h +++ b/src/ca/tcpRecvWatchdog.h @@ -41,6 +41,8 @@ private: bool responsePending; bool beaconAnomaly; expireStatus expire ( const epicsTime & currentTime ); + tcpRecvWatchdog ( const tcpRecvWatchdog & ); + tcpRecvWatchdog & operator = ( const tcpRecvWatchdog & ); }; #endif // #ifndef tcpRecvWatchdogh diff --git a/src/ca/tcpSendWatchdog.h b/src/ca/tcpSendWatchdog.h index b0e766079..b07116973 100644 --- a/src/ca/tcpSendWatchdog.h +++ b/src/ca/tcpSendWatchdog.h @@ -31,6 +31,8 @@ private: epicsTimer & timer; tcpiiu & iiu; expireStatus expire ( const epicsTime & currentTime ); + tcpSendWatchdog ( const tcpSendWatchdog & ); + tcpSendWatchdog & operator = ( const tcpSendWatchdog & ); }; #endif // #ifndef tcpSendWatchdog diff --git a/src/ca/udpiiu.h b/src/ca/udpiiu.h index bc635f4e1..4426c650a 100644 --- a/src/ca/udpiiu.h +++ b/src/ca/udpiiu.h @@ -99,6 +99,9 @@ private: const osiSockAddr &net_addr, const epicsTime & ); friend void cacRecvThreadUDP ( void *pParam ); + + udpiiu ( const udpiiu & ); + udpiiu & operator = ( const udpiiu & ); }; inline bool udpiiu::isCurrentThread () const diff --git a/src/ca/virtualCircuit.h b/src/ca/virtualCircuit.h index f689f1ee2..4ec8101e5 100644 --- a/src/ca/virtualCircuit.h +++ b/src/ca/virtualCircuit.h @@ -139,6 +139,9 @@ private: friend void cacSendThreadTCP ( void *pParam ); friend void cacRecvThreadTCP ( void *pParam ); + + tcpiiu ( const tcpiiu & ); + tcpiiu & operator = ( const tcpiiu & ); }; inline void tcpiiu::flushRequest () diff --git a/src/db/dbCAC.h b/src/db/dbCAC.h index 7a7a4def2..4aaa2814d 100644 --- a/src/db/dbCAC.h +++ b/src/db/dbCAC.h @@ -39,6 +39,9 @@ public: virtual dbSubscriptionIO * isSubscription () = 0; virtual void destroy () = 0; virtual void show ( unsigned level ) const = 0; + dbBaseIO (); + dbBaseIO ( const dbBaseIO & ); + dbBaseIO & operator = ( const dbBaseIO & ); }; class dbPutNotifyBlocker : public dbBaseIO { @@ -62,6 +65,8 @@ private: static tsFreeList < dbPutNotifyBlocker > freeList; static epicsMutex freeListMutex; friend void putNotifyCompletion ( putNotify *ppn ); + dbPutNotifyBlocker ( const dbPutNotifyBlocker & ); + dbPutNotifyBlocker & operator = ( const dbPutNotifyBlocker & ); }; extern "C" void dbSubscriptionEventCallback ( void *pPrivate, struct dbAddr *paddr, @@ -91,6 +96,8 @@ private: static epicsMutex freeListMutex; friend void dbSubscriptionEventCallback ( void *pPrivate, struct dbAddr *paddr, int eventsRemaining, struct db_field_log *pfl ); + dbSubscriptionIO ( const dbSubscriptionIO & ); + dbSubscriptionIO & operator = ( const dbSubscriptionIO & ); }; class dbServiceIO; @@ -102,6 +109,8 @@ private: tsDLList < dbSubscriptionIO > eventq; dbPutNotifyBlocker *pBlocker; friend class dbServiceIO; + dbServicePrivateListOfIO ( const dbServicePrivateListOfIO & ); + dbServicePrivateListOfIO & operator = ( const dbServicePrivateListOfIO & ); }; class dbChannelIO : public cacChannel, public dbServicePrivateListOfIO { @@ -138,6 +147,8 @@ private: static tsFreeList < dbChannelIO > freeList; static epicsMutex freeListMutex; static unsigned nextIdForIO; + dbChannelIO ( const dbChannelIO & ); + dbChannelIO & operator = ( const dbChannelIO & ); }; class dbServiceIO : public cacService { @@ -166,6 +177,8 @@ private: dbEventCtx ctx; char *pEventCallbackCache; mutable epicsMutex mutex; + dbServiceIO ( const dbServiceIO & ); + dbServiceIO & operator = ( const dbServiceIO & ); }; inline dbServicePrivateListOfIO::dbServicePrivateListOfIO () : diff --git a/src/db/dbServiceIO.cpp b/src/db/dbServiceIO.cpp index 968c429ec..b3fcafd9f 100644 --- a/src/db/dbServiceIO.cpp +++ b/src/db/dbServiceIO.cpp @@ -50,6 +50,8 @@ public: dbServiceIOLoadTimeInit (); private: dbServiceIO dbio; + dbServiceIOLoadTimeInit ( const dbServiceIOLoadTimeInit & ); + dbServiceIOLoadTimeInit & operator = ( const dbServiceIOLoadTimeInit & ); }; // The following is just to force lti to be constructed @@ -58,6 +60,8 @@ extern "C" void dbServiceIOInit() static dbServiceIOLoadTimeInit lti; } +dbBaseIO::dbBaseIO () {} + dbServiceIOLoadTimeInit::dbServiceIOLoadTimeInit () { cacGlobalServiceList.registerService ( this->dbio ); diff --git a/src/libCom/fdmgr/fdManager.cpp b/src/libCom/fdmgr/fdManager.cpp index 564af4c05..a72c1a2f5 100644 --- a/src/libCom/fdmgr/fdManager.cpp +++ b/src/libCom/fdmgr/fdManager.cpp @@ -67,20 +67,6 @@ template class resTable < fdReg, fdRegId >; epicsShareDef fdManager fileDescriptorManager; -// -// this must allow at least enough bits for all states -// in type "fdRegType". The actual size of the table -// is used because it improves performance. -// -inline const unsigned fdRegId::minIndexBitWidth () -{ - return fdManagerHashTableMinIndexBits; -} -inline const unsigned fdRegId::maxIndexBitWidth () -{ - return fdManagerHashTableMaxIndexBits; -} - // // fdManager::fdManager() // diff --git a/src/libCom/fdmgr/fdManager.h b/src/libCom/fdmgr/fdManager.h index 72c93a0e0..c162d9baa 100644 --- a/src/libCom/fdmgr/fdManager.h +++ b/src/libCom/fdmgr/fdManager.h @@ -74,13 +74,10 @@ public: resTableIndex hash () const; - static const unsigned minIndexBitWidth (); - static const unsigned maxIndexBitWidth (); - virtual void show (unsigned level) const; private: - const SOCKET fd; - const fdRegType type; + SOCKET fd; + fdRegType type; }; // @@ -121,6 +118,8 @@ private: epicsShareFunc void installReg (fdReg ®); epicsShareFunc void removeReg (fdReg ®); void lazyInitTimerQueue (); + fdManager ( const fdManager & ); + fdManager & operator = ( const fdManager & ); friend class fdReg; }; @@ -171,6 +170,9 @@ private: unsigned char state; // state enums go here unsigned char onceOnly; fdManager &manager; + + fdReg ( const fdReg & ); + fdReg & operator = ( const fdReg & ); }; static const unsigned fdManagerHashTableMinIndexBits = 8; diff --git a/src/libCom/fdmgr/fdmgr.cpp b/src/libCom/fdmgr/fdmgr.cpp index 30c67c31e..928718fbb 100644 --- a/src/libCom/fdmgr/fdmgr.cpp +++ b/src/libCom/fdmgr/fdmgr.cpp @@ -60,6 +60,8 @@ private: pCallBackFDMgr pFunc; void *pParam; epicsShareFunc virtual void callBack (); + fdRegForOldFdmgr ( const fdRegForOldFdmgr & ); + fdRegForOldFdmgr & operator = ( const fdRegForOldFdmgr & ); }; class oldFdmgr; @@ -84,6 +86,8 @@ private: void *pParam; unsigned id; epicsShareFunc expireStatus expire ( const epicsTime & currentTime ); + timerForOldFdmgr ( const timerForOldFdmgr & ); + timerForOldFdmgr & operator = ( const timerForOldFdmgr & ); }; class oldFdmgr : public fdManager { @@ -95,6 +99,8 @@ public: private: chronIntIdResTable resTbl; + oldFdmgr ( const oldFdmgr & ); + oldFdmgr & operator = ( const oldFdmgr & ); }; #if defined ( _MSC_VER ) @@ -181,7 +187,7 @@ extern "C" epicsShareFunc fdmgrAlarmId epicsShareAPI fdmgr_add_timeout ( double delay = ptimeout->tv_sec + ptimeout->tv_usec / static_cast (epicsTime::uSecPerSec); oldFdmgr *pfdm = static_cast (pfdctx); timerForOldFdmgr *pTimer; - unsigned id; + unsigned id = fdmgrNoAlarm; if (!pfdm) { return fdmgrNoAlarm; @@ -206,7 +212,6 @@ extern "C" epicsShareFunc fdmgrAlarmId epicsShareAPI fdmgr_add_timeout ( } } else { - id = fdmgrNoAlarm; break; } } diff --git a/src/libCom/misc/ipAddrToAsciiAsynchronous.h b/src/libCom/misc/ipAddrToAsciiAsynchronous.h index c8492582d..6bf3f42e9 100644 --- a/src/libCom/misc/ipAddrToAsciiAsynchronous.h +++ b/src/libCom/misc/ipAddrToAsciiAsynchronous.h @@ -48,6 +48,8 @@ private: bool callbackInProgress; bool waitingForCancelPendCompletion; static epicsMutex mutex; + ipAddrToAsciiEngine ( const ipAddrToAsciiEngine & ); + ipAddrToAsciiEngine & operator = ( const ipAddrToAsciiEngine & ); friend class ipAddrToAsciiAsynchronous; }; diff --git a/src/libCom/osi/epicsMutex.h b/src/libCom/osi/epicsMutex.h index 872c6582e..6bad256ab 100644 --- a/src/libCom/osi/epicsMutex.h +++ b/src/libCom/osi/epicsMutex.h @@ -50,7 +50,7 @@ public: ~epicsAutoMutexRelease (); private: epicsAutoMutexRelease ( const epicsAutoMutex & ); - epicsAutoMutexRelease & operator = ( const epicsAutoMutex & ); + epicsAutoMutexRelease & operator = ( const epicsAutoMutexRelease & ); epicsMutex & rMutex; }; @@ -114,8 +114,7 @@ inline epicsMutex ::~epicsMutex () inline void epicsMutex :: lock () { - epicsMutexLockStatus status; - status = epicsMutexLock ( this->id ); + epicsMutexLockStatus status = epicsMutexLock ( this->id ); if ( status != epicsMutexLockOK ) { throwWithLocation ( invalidSemaphore () ); } @@ -123,8 +122,7 @@ inline void epicsMutex :: lock () inline bool epicsMutex :: lock ( double timeOut ) { - epicsMutexLockStatus status; - status = epicsMutexLockWithTimeout ( this->id, timeOut ); + epicsMutexLockStatus status = epicsMutexLockWithTimeout ( this->id, timeOut ); if (status==epicsMutexLockOK) { return true; } else if (status==epicsMutexLockTimeout) { @@ -137,8 +135,7 @@ inline bool epicsMutex :: lock ( double timeOut ) inline bool epicsMutex :: tryLock () { - epicsMutexLockStatus status; - status = epicsMutexTryLock ( this->id ); + epicsMutexLockStatus status = epicsMutexTryLock ( this->id ); if ( status == epicsMutexLockOK ) { return true; } else if ( status == epicsMutexLockTimeout ) { diff --git a/src/libCom/timer/timerPrivate.h b/src/libCom/timer/timerPrivate.h index 364ec18ac..d49976051 100644 --- a/src/libCom/timer/timerPrivate.h +++ b/src/libCom/timer/timerPrivate.h @@ -61,6 +61,7 @@ private: timerQueue &queue; void privateStart ( epicsTimerNotify & notify, const epicsTime & ); void privateCancel (); + timer & operator = ( const timer & ); friend class timerQueue; }; @@ -74,6 +75,7 @@ private: epicsTimerCallback pCallBack; void * pPrivate; expireStatus expire ( const epicsTime & currentTime ); + epicsTimerForC & operator = ( const epicsTimerForC & ); friend class timerQueue; }; @@ -96,6 +98,8 @@ private: timer *pExpireTmr; epicsThreadId processThread; bool cancelPending; + timerQueue ( const timerQueue & ); + timerQueue & operator = ( const timerQueue & ); friend class timer; }; @@ -132,6 +136,8 @@ private: void run (); void reschedule (); epicsTimerQueue & getEpicsTimerQueue (); + timerQueueActive ( const timerQueueActive & ); + timerQueueActive & operator = ( const timerQueueActive & ); }; struct epicsTimerQueueActiveForC : public timerQueueActive, @@ -146,10 +152,13 @@ protected: private: static tsFreeList < epicsTimerQueueActiveForC > freeList; static epicsMutex freeListMutex; + epicsTimerQueueActiveForC ( const epicsTimerQueueActiveForC & ); + epicsTimerQueueActiveForC & operator = ( const epicsTimerQueueActiveForC & ); }; class timerQueueActiveMgr { public: + timerQueueActiveMgr (); ~timerQueueActiveMgr (); epicsTimerQueueActiveForC & allocate ( bool okToShare, unsigned threadPriority = epicsThreadPriorityMin + 10 ); @@ -157,6 +166,8 @@ public: private: epicsMutex mutex; tsDLList < epicsTimerQueueActiveForC > sharedQueueList; + timerQueueActiveMgr ( const timerQueueActiveMgr & ); + timerQueueActiveMgr & operator = ( const timerQueueActiveMgr & ); }; extern timerQueueActiveMgr queueMgr; @@ -173,6 +184,8 @@ protected: timerQueue queue; ~timerQueuePassive (); epicsTimerQueue & getEpicsTimerQueue (); + timerQueuePassive ( const timerQueuePassive & ); + timerQueuePassive & operator = ( const timerQueuePassive & ); }; inline epicsTimerForC & timerQueue::createTimerForC diff --git a/src/libCom/timer/timerQueueActiveMgr.cpp b/src/libCom/timer/timerQueueActiveMgr.cpp index ddc1d630b..65afbd3ea 100644 --- a/src/libCom/timer/timerQueueActiveMgr.cpp +++ b/src/libCom/timer/timerQueueActiveMgr.cpp @@ -33,6 +33,10 @@ #define epicsExportSharedSymbols #include "timerPrivate.h" +timerQueueActiveMgr::timerQueueActiveMgr () +{ +} + timerQueueActiveMgr::~timerQueueActiveMgr () { epicsAutoMutex locker ( this->mutex );