added try/catch blocks so that we hopefully can bridge

periods where the new general time provides (unexpectedly
considering its advertised benfits) no time at all.
This commit is contained in:
Jeff Hill
2009-05-11 22:50:06 +00:00
parent 20bd4e9b23
commit 8d245ba595
5 changed files with 67 additions and 12 deletions

View File

@@ -14,7 +14,8 @@
* 505 665 1831
*/
#include <stdio.h>
#include <cstdio>
#include <cfloat>
#define epicsExportSharedSymbols
#include "epicsGuard.h"
@@ -46,13 +47,22 @@ timerQueue::~timerQueue ()
void timerQueue ::
printExceptMsg ( const char * pName, const type_info & type )
{
epicsTime cur = epicsTime :: getCurrent ();
double delay = cur - this->exceptMsgTimeStamp;
if ( delay >= exceptMsgMinPeriod ) {
this->exceptMsgTimeStamp = cur;
char date[64];
char date[64];
double delay;
try {
epicsTime cur = epicsTime :: getCurrent ();
delay = cur - this->exceptMsgTimeStamp;
cur.strftime ( date, sizeof ( date ),
"%a %b %d %Y %H:%M:%S.%f" );
if ( delay >= exceptMsgMinPeriod ) {
this->exceptMsgTimeStamp = cur;
}
}
catch ( ... ) {
delay = DBL_MAX;
strcpy ( date, "UKN DATE" );
}
if ( delay >= exceptMsgMinPeriod ) {
// we dont touch the typeid for the timer expiration
// notify interface here because they might have
// destroyed the timer during its callback