dont try to cancel _main_

This commit is contained in:
Marty Kraimer
2004-09-29 13:32:11 +00:00
parent 81bc2a0d7a
commit ef292bffe6

View File

@@ -67,6 +67,8 @@ static ELLLIST pthreadList;
static commonAttr *pcommonAttr = 0;
static int epicsThreadOnceCalled = 0;
static epicsThreadOSD *createImplicit(void);
#define checkStatus(status,message) \
if((status)) {\
errlogPrintf("%s error %s\n",(message),strerror((status))); \
@@ -111,9 +113,12 @@ static void myAtExit(void)
status = pthread_mutex_lock(&listLock);
checkStatusQuit(status,"pthread_mutex_lock","myAtExit");
pthreadSelf = (epicsThreadOSD *)pthread_getspecific(getpthreadInfo);
if(pthreadSelf==NULL)
pthreadSelf = createImplicit();
pthreadInfo=(epicsThreadOSD *)ellFirst(&pthreadList);
while(pthreadInfo) {
if(pthreadInfo != pthreadSelf){ /* dont cancel this thread! */
if(pthreadInfo != pthreadSelf /*dont cancel this thread*/
&& (strcmp("_main_",pthreadInfo->name)!=0)){/* dont cancel main*/
pthread_cancel(pthreadInfo->tid);
}
pthreadInfo=(epicsThreadOSD *)ellNext(&pthreadInfo->node);