From 9a277c0a3b1b825350a6b2aba929bcb799744faf Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 29 Feb 2000 22:47:41 +0000 Subject: [PATCH] fixed deadlock --- src/libCom/timer/osiTimer.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/libCom/timer/osiTimer.cpp b/src/libCom/timer/osiTimer.cpp index 8666d6b7a..b24c2cdb0 100644 --- a/src/libCom/timer/osiTimer.cpp +++ b/src/libCom/timer/osiTimer.cpp @@ -560,19 +560,28 @@ void osiTimerQueue::process () pTmr->curState = osiTimer::stateIdle; this->idle.add (*pTmr); -#ifdef DEBUG - double diff = cur-pTmr->exp; - printf ("expired %lx for \"%s\" with error %f\n", - (unsigned long)pTmr, pTmr->name(), diff); -#endif - // // Tag current tmr so that we // can detect if it was deleted // during the expire call back // this->pExpireTmr = pTmr; + + // + // remove lock while calling their callback + // + this->mutex.unlock (); + +#ifdef DEBUG + double diff = cur-pTmr->exp; + printf ("expired %lx for \"%s\" with error %f\n", + (unsigned long)pTmr, pTmr->name(), diff); +#endif + pTmr->expire(); + + this-> mutex.lock(); + if ( this->pExpireTmr == pTmr ) { if ( pTmr->again () ) { this->idle.remove (*pTmr);