removed atexit handler that calls epicsThreadExit because:
o recursive exit call is bad o this causes shutdown problems with DLL codes on windows => the workaround is an atexit handler that calls epicsExitCallAtExits in the poosix osdThreads atexit handler
This commit is contained in:
@@ -14,11 +14,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "ellLib.h"
|
||||
#include "epicsThread.h"
|
||||
#include "epicsMutex.h"
|
||||
#include "cantProceed.h"
|
||||
#define epicsExportSharedSymbols
|
||||
#include "epicsExit.h"
|
||||
|
||||
typedef void (*epicsExitFunc)(void *arg);
|
||||
@@ -38,13 +38,10 @@ static exitPvt exitPvtInstance;
|
||||
static exitPvt *pexitPvt = &exitPvtInstance;
|
||||
static epicsThreadOnceId createOnce = EPICS_THREAD_ONCE_INIT;
|
||||
|
||||
static void atExit(void) {epicsExit(0);}
|
||||
|
||||
static void createExitPvt(void)
|
||||
{
|
||||
pexitPvt->lock = epicsMutexMustCreate();
|
||||
ellInit(&pexitPvt->list);
|
||||
atexit(atExit);
|
||||
}
|
||||
|
||||
epicsShareFunc void epicsShareAPI epicsExitCallAtExits(void)
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "cantProceed.h"
|
||||
#include "errlog.h"
|
||||
#include "epicsAssert.h"
|
||||
#include "epicsExit.h"
|
||||
|
||||
/* Until these can be demonstrated to work leave them undefined*/
|
||||
#undef _POSIX_THREAD_ATTR_STACKSIZE
|
||||
@@ -106,6 +107,7 @@ static void myAtExit(void)
|
||||
fprintf(stderr,"osdThread myAtExit extered multiple times\n");
|
||||
return;
|
||||
}
|
||||
epicsExitCallAtExits();
|
||||
status = pthread_mutex_lock(&listLock);
|
||||
checkStatusQuit(status,"pthread_mutex_lock","myAtExit");
|
||||
pthreadSelf = (epicsThreadOSD *)pthread_getspecific(getpthreadInfo);
|
||||
|
||||
Reference in New Issue
Block a user