o print date when unexpected exception occurs

o call std::unexpected() when unexpected exception occurs
This commit is contained in:
Jeff Hill
2004-09-29 17:39:17 +00:00
parent fddaeb1dc8
commit 9f8e75b945
+18 -3
View File
@@ -46,19 +46,34 @@ extern "C" void epicsThreadCallEntryPoint ( void * pPvt )
}
catch ( std::exception & except ) {
if ( ! waitRelease ) {
epicsTime cur = epicsTime::getCurrent ();
char date[64];
cur.strftime ( date, sizeof ( date ), "%a %b %d %Y %H:%M:%S.%f");
char name [128];
epicsThreadGetName ( pThread->id, name, sizeof ( name ) );
errlogPrintf (
"epicsThread: Unexpected C++ exception \"%s\" with type \"%s\" - terminating thread \"%s\"",
except.what (), typeid ( except ).name (), name );
"epicsThread: Unexpected C++ exception \"%s\" with type \"%s\" in thread \"%s\" at %s\n",
except.what (), typeid ( except ).name (), name, date );
// this should behave as the C++ implementation intends when an
// exception isnt handled. If users dont like this behavior, they
// can install an application specific unexpected handler.
std::unexpected ();
}
}
catch ( ... ) {
if ( ! waitRelease ) {
epicsTime cur = epicsTime::getCurrent ();
char date[64];
cur.strftime ( date, sizeof ( date ), "%a %b %d %Y %H:%M:%S.%f");
char name [128];
epicsThreadGetName ( pThread->id, name, sizeof ( name ) );
errlogPrintf (
"epicsThread: Unknown C++ exception - terminating thread \"%s\"", name );
"epicsThread: Unknown C++ exception in thread \"%s\" at %s\n",
name, date );
// this should behave as the C++ implementation intends when an
// exception isnt handled. If users dont like this behavior, they
// can install an application specific unexpected handler.
std::unexpected ();
}
}
if ( ! waitRelease ) {