cancel threads in inverse order of creation

This commit is contained in:
Marty Kraimer
2004-11-04 14:01:20 +00:00
parent dc2fb8bb5c
commit d2c672d238
+2 -2
View File
@@ -125,13 +125,13 @@ static void myAtExit(void)
pthreadSelf = (epicsThreadOSD *)pthread_getspecific(getpthreadInfo);
if(pthreadSelf==NULL)
pthreadSelf = createImplicit();
pthreadInfo=(epicsThreadOSD *)ellFirst(&pthreadList);
pthreadInfo=(epicsThreadOSD *)ellLast(&pthreadList);
while(pthreadInfo) {
if(pthreadInfo != pthreadSelf /*dont cancel this thread*/
&& (strcmp("_main_",pthreadInfo->name)!=0)){/* dont cancel main*/
pthread_cancel(pthreadInfo->tid);
}
pthreadInfo=(epicsThreadOSD *)ellNext(&pthreadInfo->node);
pthreadInfo=(epicsThreadOSD *)ellPrevious(&pthreadInfo->node);
}
status = pthread_mutex_unlock(&listLock);
checkStatusQuit(status,"pthread_mutex_unlock","myAtExit");