diff --git a/src/libCom/error/errlog.c b/src/libCom/error/errlog.c index 8d61993ce..38948beaf 100644 --- a/src/libCom/error/errlog.c +++ b/src/libCom/error/errlog.c @@ -72,13 +72,13 @@ typedef struct msgNode { LOCAL struct { epicsEventId errlogTaskWaitForWork; - epicsEventId errlogStopWaitForStop; + epicsEventId errlogFlushWaitForFlush; epicsMutexId msgQueueLock; epicsMutexId listenerLock; ELLLIST listenerList; ELLLIST msgQueue; msgNode *pnextSend; - int stopNow; + int flushNow; int errlogInitFailed; int buffersize; int sevToLog; @@ -312,7 +312,7 @@ static void errlogInitPvt(void *arg) ellInit(&pvtData.msgQueue); pvtData.toConsole = TRUE; pvtData.errlogTaskWaitForWork = epicsEventMustCreate(epicsEventEmpty); - pvtData.errlogStopWaitForStop = epicsEventMustCreate(epicsEventEmpty); + pvtData.errlogFlushWaitForFlush = epicsEventMustCreate(epicsEventEmpty); pvtData.listenerLock = epicsMutexMustCreate(); pvtData.msgQueueLock = epicsMutexMustCreate(); /*Allow an extra MAX_MESSAGE_SIZE for extra margain of safety*/ @@ -336,11 +336,11 @@ epicsShareFunc int epicsShareAPI errlogInit(int bufsize) return(0); } -epicsShareFunc void epicsShareAPI errlogStop(void) +epicsShareFunc void epicsShareAPI errlogFlush(void) { - pvtData.stopNow = 1; + pvtData.flushNow = 1; epicsEventSignal(pvtData.errlogTaskWaitForWork); - epicsEventMustWait(pvtData.errlogStopWaitForStop); + epicsEventMustWait(pvtData.errlogFlushWaitForFlush); } LOCAL void errlogTask(void) @@ -362,11 +362,9 @@ LOCAL void errlogTask(void) epicsMutexUnlock(pvtData.listenerLock); msgbufFreeSend(); } - if(!pvtData.stopNow) continue; + if(!pvtData.flushNow) continue; epicsThreadSleep(.2); /*just wait an extra .2 seconds*/ - /*SHOULD HAVE WAY OF NOTIFYING LISTENERS*/ - epicsEventSignal(pvtData.errlogStopWaitForStop); - break; + epicsEventSignal(pvtData.errlogFlushWaitForFlush); } } diff --git a/src/libCom/error/errlog.h b/src/libCom/error/errlog.h index 0f068fbc2..c1fb7378a 100644 --- a/src/libCom/error/errlog.h +++ b/src/libCom/error/errlog.h @@ -63,7 +63,7 @@ epicsShareFunc void epicsShareAPI errlogRemoveListener( epicsShareFunc int epicsShareAPI eltc(int yesno); epicsShareFunc int epicsShareAPI errlogInit(int bufsize); -epicsShareFunc void epicsShareAPI errlogStop(void); +epicsShareFunc void epicsShareAPI errlogFlush(void); /*other routines that write to log file*/ epicsShareFunc void epicsShareAPIV errPrintf(long status, const char *pFileName,