fixed race condition gdd_NEWDEL_NEW macro

This commit is contained in:
Jeff Hill
2009-07-01 22:19:53 +00:00
parent cc3245bf65
commit 6129bfc8d5

View File

@@ -95,18 +95,17 @@ void gddGlobalCleanupAdd ( void * pBuf );
int tot; \
clas *nn,*dn; \
epicsThreadOnce ( &once, clas##_gddNewDelInit, 0 ); \
epicsGuard < epicsMutex > guard ( *clas::pNewdel_lock ); \
if(!clas::newdel_freelist) { \
tot=gdd_CHUNK_NUM; \
nn=(clas*)malloc(gdd_CHUNK(clas)); \
gddGlobalCleanupAdd (nn); \
for(dn=nn;--tot;dn++) dn->newdel_setNext((char*)(dn+1)); \
epicsGuard < epicsMutex > guard ( *clas::pNewdel_lock ); \
(dn)->newdel_setNext(clas::newdel_freelist); \
clas::newdel_freelist=(char*)nn; \
} \
if(size==sizeof(clas)) { \
{ \
epicsGuard < epicsMutex > guard ( *clas::pNewdel_lock ); \
dn=(clas*)clas::newdel_freelist; \
clas::newdel_freelist=((clas*)clas::newdel_freelist)->newdel_next(); \
} \