From 56c4c92588843d2f1ff2f22951108aba11dba7a6 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Mon, 10 Aug 2009 21:41:59 +0000 Subject: [PATCH] improved show diagnostic --- src/libCom/timer/timer.cpp | 11 +++-------- src/libCom/timer/timerQueueActive.cpp | 5 ++++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/libCom/timer/timer.cpp b/src/libCom/timer/timer.cpp index 441afda21..788bf6d61 100644 --- a/src/libCom/timer/timer.cpp +++ b/src/libCom/timer/timer.cpp @@ -189,12 +189,6 @@ epicsTimer::expireInfo timer::getExpireInfo () const void timer::show ( unsigned int level ) const { epicsGuard < epicsMutex > locker ( this->queue.mutex ); - const char * pName = ""; - const char *pStateName; - - if ( this->pNotify ) { - pName = typeid ( *this->pNotify ).name (); - } double delay; if ( this->curState == statePending || this->curState == stateActive ) { try { @@ -207,6 +201,7 @@ void timer::show ( unsigned int level ) const else { delay = -DBL_MAX; } + const char *pStateName; if ( this->curState == statePending ) { pStateName = "pending"; } @@ -219,8 +214,8 @@ void timer::show ( unsigned int level ) const else { pStateName = "corrupt"; } - printf ( "%s, state = %s, delay = %f\n", - pName, pStateName, delay ); + printf ( "timer, state = %s, delay = %f\n", + pStateName, delay ); if ( level >= 1u && this->pNotify ) { this->pNotify->show ( level - 1u ); } diff --git a/src/libCom/timer/timerQueueActive.cpp b/src/libCom/timer/timerQueueActive.cpp index fd4c2bfea..a1c25f4a0 100644 --- a/src/libCom/timer/timerQueueActive.cpp +++ b/src/libCom/timer/timerQueueActive.cpp @@ -131,7 +131,10 @@ void timerQueueActive::show ( unsigned int level ) const { printf ( "EPICS threaded timer queue at %p\n", static_cast ( this ) ); - if ( level >=1u ) { + if ( level > 0u ) { + // specifying level one here avoids recursive + // show callback + this->thread.show ( 1u ); this->queue.show ( level - 1u ); printf ( "reschedule event\n" ); this->rescheduleEvent.show ( level - 1u );