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:
Jeff Hill
2004-09-16 18:22:33 +00:00
parent 63aba004d1
commit 3d377eed1d
2 changed files with 3 additions and 4 deletions
+1 -4
View File
@@ -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)
+2
View File
@@ -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);