From d2c672d23812fc9b84c7b82f85c1f38fa778b691 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Thu, 4 Nov 2004 14:01:20 +0000 Subject: [PATCH] cancel threads in inverse order of creation --- src/libCom/osi/os/posix/osdThread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libCom/osi/os/posix/osdThread.c b/src/libCom/osi/os/posix/osdThread.c index 63e536be2..e20c9b6e0 100644 --- a/src/libCom/osi/os/posix/osdThread.c +++ b/src/libCom/osi/os/posix/osdThread.c @@ -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");