installed into cvs

This commit is contained in:
Jeff Hill
2002-03-21 23:52:51 +00:00
parent 51286f5d4f
commit d9d84a5695
6 changed files with 393 additions and 0 deletions
@@ -0,0 +1,30 @@
/*
* $Id$
*
* Author: Jeffrey O. Hill
*
*/
#include <new>
#define epicsExportSharedSymbols
#include "epicsMutex.h"
#include "epicsGuard.h"
#include "epicsSingleton.h"
epicsMutex epicsSingletonBase::mutex;
epicsSingletonBase::~epicsSingletonBase ()
{
}
void epicsSingletonBase::lockedFactory ()
{
epicsGuard < epicsMutex > guard ( this->mutex );
if ( ! this->pSingleton ) {
this->pSingleton = this->factory ();
if ( ! this->pSingleton ) {
throw std::bad_alloc ();
}
}
}