From 0fb320c263a3f14ddc82690338cc5d9d8d76a599 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 9 Jul 2009 18:37:26 +0000 Subject: [PATCH] (M. Davidsaver): Use ELLLIST init macros. --- src/db/dbBkpt.c | 3 +-- src/db/dbCa.c | 3 +-- src/db/initHooks.c | 3 +-- src/dbStatic/dbLexRoutines.c | 6 ++---- src/libCom/osi/os/posix/osdThread.c | 3 +-- src/libCom/taskwd/taskwd.c | 11 +++-------- 6 files changed, 9 insertions(+), 20 deletions(-) diff --git a/src/db/dbBkpt.c b/src/db/dbBkpt.c index e8a6a2899..6160415b2 100644 --- a/src/db/dbBkpt.c +++ b/src/db/dbBkpt.c @@ -153,7 +153,7 @@ long lset_stack_count = 0; * The semaphore is used to prevent conflicts while * operating with this stack. */ -static ELLLIST lset_stack; +static ELLLIST lset_stack = ELLLIST_INIT; static epicsMutexId bkpt_stack_sem = 0; /* @@ -257,7 +257,6 @@ void epicsShareAPI dbBkptInit(void) { if (! bkpt_stack_sem) { bkpt_stack_sem = epicsMutexMustCreate(); - ellInit(&lset_stack); lset_stack_count = 0; } } diff --git a/src/db/dbCa.c b/src/db/dbCa.c index 6ceb30fe4..0364c42bd 100644 --- a/src/db/dbCa.c +++ b/src/db/dbCa.c @@ -53,7 +53,7 @@ extern void dbServiceIOInit(); -static ELLLIST workList; /* Work list for dbCaTask */ +static ELLLIST workList = ELLLIST_INIT; /* Work list for dbCaTask */ static epicsMutexId workListLock; /*Mutual exclusions semaphores for workList*/ static epicsEventId workListEvent; /*wakeup event for dbCaTask*/ static int removesOutstanding = 0; @@ -185,7 +185,6 @@ static void dbCaShutdown(void *arg) void dbCaLinkInit(void) { dbServiceIOInit(); - ellInit(&workList); workListLock = epicsMutexMustCreate(); workListEvent = epicsEventMustCreate(epicsEventEmpty); startStopEvent = epicsEventMustCreate(epicsEventEmpty); diff --git a/src/db/initHooks.c b/src/db/initHooks.c index caf2a04d9..c99506399 100644 --- a/src/db/initHooks.c +++ b/src/db/initHooks.c @@ -29,7 +29,7 @@ typedef struct initHookLink { initHookFunction func; } initHookLink; -static ELLLIST functionList; +static ELLLIST functionList = ELLLIST_INIT; static epicsMutexId listLock; /* @@ -37,7 +37,6 @@ static epicsMutexId listLock; */ static void initHookOnce(void *arg) { - ellInit(&functionList); listLock = epicsMutexMustCreate(); } diff --git a/src/dbStatic/dbLexRoutines.c b/src/dbStatic/dbLexRoutines.c index a2cdb03ce..b5f969d7c 100644 --- a/src/dbStatic/dbLexRoutines.c +++ b/src/dbStatic/dbLexRoutines.c @@ -95,7 +95,7 @@ typedef struct inputFile{ FILE *fp; int line_num; }inputFile; -static ELLLIST inputFileList; +static ELLLIST inputFileList = ELLLIST_INIT; static inputFile *pinputFileNow = NULL; static DBBASE *pdbbase = NULL; @@ -105,7 +105,7 @@ typedef struct tempListNode { void *item; }tempListNode; -static ELLLIST tempList; +static ELLLIST tempList = ELLLIST_INIT; static void *freeListPvt = NULL; static int duplicate = FALSE; @@ -212,8 +212,6 @@ static long dbReadCOM(DBBASE **ppdbbase,const char *filename, FILE *fp, } } my_buffer = dbCalloc(MY_BUFFER_SIZE,sizeof(char)); - ellInit(&inputFileList); - ellInit(&tempList); freeListInitPvt(&freeListPvt,sizeof(tempListNode),100); if(substitutions) { if(macCreateHandle(&macHandle,NULL)) { diff --git a/src/libCom/osi/os/posix/osdThread.c b/src/libCom/osi/os/posix/osdThread.c index 18126b389..5d101f9a1 100644 --- a/src/libCom/osi/os/posix/osdThread.c +++ b/src/libCom/osi/os/posix/osdThread.c @@ -78,7 +78,7 @@ typedef struct epicsThreadOSD { static pthread_key_t getpthreadInfo; static pthread_mutex_t onceLock; static pthread_mutex_t listLock; -static ELLLIST pthreadList; +static ELLLIST pthreadList = ELLLIST_INIT; static commonAttr *pcommonAttr = 0; static int epicsThreadOnceCalled = 0; @@ -211,7 +211,6 @@ static void once(void) checkStatusQuit(status,"pthread_mutex_init","epicsThreadInit"); status = pthread_mutex_init(&listLock,0); checkStatusQuit(status,"pthread_mutex_init","epicsThreadInit"); - ellInit(&pthreadList); pcommonAttr = calloc(1,sizeof(commonAttr)); if(!pcommonAttr) checkStatusOnceQuit(errno,"calloc","epicsThreadInit"); status = pthread_attr_init(&pcommonAttr->attr); diff --git a/src/libCom/taskwd/taskwd.c b/src/libCom/taskwd/taskwd.c index 4f7469288..b77361236 100644 --- a/src/libCom/taskwd/taskwd.c +++ b/src/libCom/taskwd/taskwd.c @@ -58,15 +58,15 @@ union twdNode { /* Registered Tasks */ static epicsMutexId tLock; -static ELLLIST tList; +static ELLLIST tList = ELLLIST_INIT; /* Active Monitors */ static epicsMutexId mLock; -static ELLLIST mList; +static ELLLIST mList = ELLLIST_INIT; /* Free List */ static epicsMutexId fLock; -static ELLLIST fList; +static ELLLIST fList = ELLLIST_INIT; /* Watchdog task control */ static enum { @@ -140,13 +140,8 @@ static void twdInitOnce(void *arg) epicsThreadId tid; tLock = epicsMutexMustCreate(); - ellInit(&tList); - mLock = epicsMutexMustCreate(); - ellInit(&mList); - fLock = epicsMutexMustCreate(); - ellInit(&fList); twdCtl = twdctlRun; loopEvent = epicsEventMustCreate(epicsEventEmpty);