From 36ffaa39684e69cc2746945a24fc758303e90cbb Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Sat, 24 Jan 2004 00:13:59 +0000 Subject: [PATCH] fix unguard needs to be moved inside of sate test (that needs to be guarded) --- src/libCom/timer/timer.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libCom/timer/timer.cpp b/src/libCom/timer/timer.cpp index ba17659e3..0c17fd72f 100644 --- a/src/libCom/timer/timer.cpp +++ b/src/libCom/timer/timer.cpp @@ -156,12 +156,10 @@ void timer::cancel () if ( this->queue.processThread != epicsThreadGetIdSelf() ) { // make certain timer expire() does not run after cancel () returns, // but dont require that lock is applied while calling expire() - { + while ( this->queue.cancelPending && + this->queue.pExpireTmr == this ) { epicsGuardRelease < epicsMutex > autoRelease ( locker ); - while ( this->queue.cancelPending && - this->queue.pExpireTmr == this ) { - this->queue.cancelBlockingEvent.wait (); - } + this->queue.cancelBlockingEvent.wait (); } // in case other threads are waiting wakeupCancelBlockingThreads = true;