diff --git a/src/db/dbCAC.h b/src/db/dbCAC.h index 90e265326..25616a3de 100644 --- a/src/db/dbCAC.h +++ b/src/db/dbCAC.h @@ -66,7 +66,7 @@ private: unsigned long count; unsigned id; dbSubscriptionIO * isSubscription (); - static epicsSingleton < tsFreeList < dbSubscriptionIO > > freeList; + static epicsSingleton < tsFreeList < dbSubscriptionIO > > pFreeList; friend void dbSubscriptionEventCallback ( void *pPrivate, struct dbAddr *paddr, int eventsRemaining, struct db_field_log *pfl ); dbSubscriptionIO ( const dbSubscriptionIO & ); @@ -117,7 +117,7 @@ private: void ioShow ( const ioid &, unsigned level ) const; short nativeType () const; unsigned long nativeElementCount () const; - static epicsSingleton < tsFreeList < dbChannelIO > > freeList; + static epicsSingleton < tsFreeList < dbChannelIO > > pFreeList; static unsigned nextIdForIO; dbChannelIO ( const dbChannelIO & ); dbChannelIO & operator = ( const dbChannelIO & ); diff --git a/src/db/dbChannelIO.cpp b/src/db/dbChannelIO.cpp index 306d822d3..5d8daf736 100644 --- a/src/db/dbChannelIO.cpp +++ b/src/db/dbChannelIO.cpp @@ -21,6 +21,7 @@ #include "tsFreeList.h" #include "epicsMutex.h" #include "epicsEvent.h" +#include "epicsSingleton.h" #include "db_access.h" #define epicsExportSharedSymbols @@ -29,7 +30,7 @@ #include "dbChannelIOIL.h" #include "dbPutNotifyBlocker.h" -tsFreeList < dbChannelIO > dbChannelIO::freeList; +epicsSingleton < tsFreeList < dbChannelIO > > dbChannelIO::pFreeList; unsigned dbChannelIO::nextIdForIO; dbChannelIO::dbChannelIO ( cacChannelNotify ¬ify, diff --git a/src/db/dbChannelIOIL.h b/src/db/dbChannelIOIL.h index 0484af12c..83acdd7ba 100644 --- a/src/db/dbChannelIOIL.h +++ b/src/db/dbChannelIOIL.h @@ -32,12 +32,12 @@ inline void dbChannelIO::destroy () inline void * dbChannelIO::operator new ( size_t size ) { - return dbChannelIO::freeList.allocate ( size ); + return dbChannelIO::pFreeList->allocate ( size ); } inline void dbChannelIO::operator delete ( void *pCadaver, size_t size ) { - dbChannelIO::freeList.release ( pCadaver, size ); + dbChannelIO::pFreeList->release ( pCadaver, size ); } inline const char *dbChannelIO::pName () const diff --git a/src/db/dbPutNotifyBlocker.cpp b/src/db/dbPutNotifyBlocker.cpp index c5ad62ec6..98378ab69 100644 --- a/src/db/dbPutNotifyBlocker.cpp +++ b/src/db/dbPutNotifyBlocker.cpp @@ -23,6 +23,7 @@ #include "epicsEvent.h" #include "epicsTime.h" #include "tsFreeList.h" +#include "epicsSingleton.h" #include "errMdef.h" #include "cacIO.h" @@ -34,7 +35,7 @@ #include "dbChannelIOIL.h" #include "dbPutNotifyBlocker.h" -tsFreeList < dbPutNotifyBlocker, 1024, 0 > dbPutNotifyBlocker::freeList; +epicsSingleton < tsFreeList < dbPutNotifyBlocker, 1024 > > dbPutNotifyBlocker::pFreeList; dbPutNotifyBlocker::dbPutNotifyBlocker ( dbChannelIO &chanIn ) : pNotify ( 0 ) diff --git a/src/db/dbPutNotifyBlocker.h b/src/db/dbPutNotifyBlocker.h index 8509d1302..c37f5f01b 100644 --- a/src/db/dbPutNotifyBlocker.h +++ b/src/db/dbPutNotifyBlocker.h @@ -36,7 +36,7 @@ private: epicsEvent block; cacWriteNotify * pNotify; dbSubscriptionIO * isSubscription (); - static epicsSingleton < tsFreeList < dbPutNotifyBlocker > > freeList; + static epicsSingleton < tsFreeList < dbPutNotifyBlocker > > pFreeList; friend void putNotifyCompletion ( putNotify *ppn ); dbPutNotifyBlocker ( const dbPutNotifyBlocker & ); dbPutNotifyBlocker & operator = ( const dbPutNotifyBlocker & ); @@ -44,12 +44,12 @@ private: inline void * dbPutNotifyBlocker::operator new ( size_t size ) { - return dbPutNotifyBlocker::freeList.allocate ( size ); + return dbPutNotifyBlocker::pFreeList->allocate ( size ); } inline void dbPutNotifyBlocker::operator delete ( void *pCadaver, size_t size ) { - dbPutNotifyBlocker::freeList.release ( pCadaver, size ); + dbPutNotifyBlocker::pFreeList->release ( pCadaver, size ); } #endif // ifndef dbPutNotifyBlockerh diff --git a/src/db/dbServiceIOReadNotifyCache.cpp b/src/db/dbServiceIOReadNotifyCache.cpp index 93e78e737..2bf05c375 100644 --- a/src/db/dbServiceIOReadNotifyCache.cpp +++ b/src/db/dbServiceIOReadNotifyCache.cpp @@ -1,6 +1,12 @@ +/* + * $Id$ + * Auther Jeff Hill + */ + #include "epicsMutex.h" #include "tsFreeList.h" +#include "epicsSingleton.h" #include "cacIO.h" #include "cadef.h" // this can be eliminated when the callbacks use the new interface diff --git a/src/db/dbSubscriptionIO.cpp b/src/db/dbSubscriptionIO.cpp index f40903206..32366c5d6 100644 --- a/src/db/dbSubscriptionIO.cpp +++ b/src/db/dbSubscriptionIO.cpp @@ -20,6 +20,7 @@ #include "epicsMutex.h" #include "epicsEvent.h" #include "tsFreeList.h" +#include "epicsSingleton.h" #include "cacIO.h" #include "db_access.h" // need to eliminate this @@ -30,7 +31,7 @@ #include "dbChannelIOIL.h" #include "db_access_routines.h" -tsFreeList < dbSubscriptionIO > dbSubscriptionIO::freeList; +epicsSingleton < tsFreeList < dbSubscriptionIO > > dbSubscriptionIO::pFreeList; dbSubscriptionIO::dbSubscriptionIO ( dbServiceIO &serviceIO, dbChannelIO &chanIO, dbAddr &addr, cacStateNotify ¬ifyIn, @@ -79,12 +80,12 @@ void dbSubscriptionIO::channelDeleteException () void * dbSubscriptionIO::operator new ( size_t size ) { - return dbSubscriptionIO::freeList.allocate ( size ); + return dbSubscriptionIO::pFreeList->allocate ( size ); } void dbSubscriptionIO::operator delete ( void *pCadaver, size_t size ) { - dbSubscriptionIO::freeList.release ( pCadaver, size ); + dbSubscriptionIO::pFreeList->release ( pCadaver, size ); } extern "C" void dbSubscriptionEventCallback ( void *pPrivate, struct dbAddr * /* paddr */,