From 6129bfc8d5229cb249082b9d8dbca6c33f987b4e Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 1 Jul 2009 22:19:53 +0000 Subject: [PATCH] fixed race condition gdd_NEWDEL_NEW macro --- src/gdd/gddNewDel.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gdd/gddNewDel.h b/src/gdd/gddNewDel.h index 4029bdd3c..c621ba3e5 100644 --- a/src/gdd/gddNewDel.h +++ b/src/gdd/gddNewDel.h @@ -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(); \ } \