epicsSingleton: eliminate global ctor with >= c++11

This commit is contained in:
Michael Davidsaver
2022-09-29 17:51:05 -07:00
parent fe9995c0b5
commit 8f1243da40

View File

@@ -23,6 +23,9 @@
class SingletonUntyped {
public:
#if __cplusplus>=201103L
constexpr
#endif
SingletonUntyped () :_pInstance ( 0 ), _refCount ( 0 ) {}
# if 0
~SingletonUntyped () {
@@ -112,6 +115,9 @@ public:
epicsSingleton * _pSingleton;
};
friend class reference;
#if __cplusplus>=201103L
constexpr
#endif
epicsSingleton () {}
// mutex lock/unlock pair overhead incurred
// when either of these are called