Fix segfault on linux - catch(...) must not call std::unexpected()

This commit is contained in:
Andrew Johnson
2008-10-08 22:44:32 +00:00
parent 0fff507aea
commit 2eb849b91c

View File

@@ -73,11 +73,14 @@ extern "C" void epicsThreadCallEntryPoint ( void * pPvt )
errlogPrintf (
"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 ();
errlogFlush ();
}
// The Linux NPTL library requires us to re-throw here; it uses
// an untyped exception object to shut down threads when we call
// pthread_cancel() in the os/posix/osdThread.c myAtExit()
// handler, and aborts with "FATAL: exception not rethrown" if
// we don't re-throw it. This solution is incomplete though...
throw;
}
if ( ! waitRelease ) {
epicsGuard < epicsMutex > guard ( pThread->mutex );