installed into cvs
This commit is contained in:
@@ -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 ();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user