diff --git a/src/misc/Makefile b/src/misc/Makefile index 24e50cf..b8bf3f0 100644 --- a/src/misc/Makefile +++ b/src/misc/Makefile @@ -15,7 +15,6 @@ INC += pv/timer.h INC += pv/status.h INC += pv/sharedPtr.h INC += pv/debugPtr.h -INC += pv/localStaticLock.h INC += pv/typeCast.h INC += pv/sharedVector.h INC += pv/templateMeta.h @@ -31,7 +30,6 @@ LIBSRCS += serializeHelper.cpp LIBSRCS += event.cpp LIBSRCS += timer.cpp LIBSRCS += status.cpp -LIBSRCS += localStaticLock.cpp LIBSRCS += typeCast.cpp LIBSRCS += thread.cpp LIBSRCS += parseToPOD.cpp diff --git a/src/misc/localStaticLock.cpp b/src/misc/localStaticLock.cpp deleted file mode 100644 index d6327dd..0000000 --- a/src/misc/localStaticLock.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* localStaticLock.cpp */ -/* - * Copyright information and license terms for this software can be - * found in the file LICENSE that is included with the distribution - */ -/** - * @author mse - */ - -#define epicsExportSharedSymbols -#include - -static int nifty_counter; -static epics::pvData::Mutex* g_localStaticInitMutex; - -epics::pvData::Mutex& getLocalStaticInitMutex() -{ - return *g_localStaticInitMutex; -} - - -// The counter is initialized at load-time, i.e., before any of the static objects are initialized. -MutexInitializer::MutexInitializer () -{ - if (0 == nifty_counter++) - { - // Initialize static members. - g_localStaticInitMutex = new epics::pvData::Mutex(); - } -} - -MutexInitializer::~MutexInitializer () -{ - if (0 == --nifty_counter) - { - // Clean-up. - delete g_localStaticInitMutex; - } -} diff --git a/src/misc/pv/localStaticLock.h b/src/misc/pv/localStaticLock.h deleted file mode 100644 index 1c1af4b..0000000 --- a/src/misc/pv/localStaticLock.h +++ /dev/null @@ -1,34 +0,0 @@ -/* localStaticLock.h */ -/* - * Copyright information and license terms for this software can be - * found in the file LICENSE that is included with the distribution - */ -/** - * @author mse - */ -#ifndef LOCALSTATICLOCK_H -#define LOCALSTATICLOCK_H - -#include - -#include - -#include - -epicsShareExtern epics::pvData::Mutex& getLocalStaticInitMutex() EPICS_DEPRECATED; - -#if defined(__GNUC__) && __GNUC__ >= 4 -// noop -#define LOCAL_STATIC_LOCK -#else -#define LOCAL_STATIC_LOCK epics::pvData::Lock localStaticInitMutexLock(getLocalStaticInitMutex()); -#endif - -static class epicsShareClass MutexInitializer { - public: - MutexInitializer (); - ~MutexInitializer (); -} localStaticMutexInitializer; // Note object here in the header. - - -#endif /* LOCALSTATICLOCK_H */