added gdd global lock

This commit is contained in:
Jeff Hill
2003-02-12 18:52:30 +00:00
parent 8e5aa40895
commit 517b60cb16
2 changed files with 15 additions and 0 deletions

View File

@@ -26,6 +26,15 @@ gdd_NEWDEL_NEW(gdd)
gdd_NEWDEL_DEL(gdd)
gdd_NEWDEL_STAT(gdd)
epicsMutex * gdd::pGlobalMutex = 0;
epicsThreadOnceId gdd::staticInitOnce = EPICS_THREAD_ONCE_INIT;
void gdd::staticInit ( void * )
{
gdd::pGlobalMutex = new epicsMutex;
assert ( gdd::pGlobalMutex );
}
class gddFlattenDestructor : public gddDestructor
{
public:
@@ -85,6 +94,8 @@ gdd::gdd(int app, aitEnum prim, int dimen, aitUint32* val)
void gdd::init(int app, aitEnum prim, int dimen)
{
epicsThreadOnce ( & gdd::staticInitOnce, gdd::staticInit, 0 );
setApplType(app);
//
// joh - we intentionally dont call setPrimType()

View File

@@ -501,6 +501,10 @@ private:
mutable aitUint32 ref_cnt;
aitUint8 flags;
static epicsMutex * pGlobalMutex;
static epicsThreadOnceId staticInitOnce;
static void staticInit ( void * );
const gdd* indexDD (aitIndex index) const;
};