diff --git a/src/libCom/osi/epicsThread.cpp b/src/libCom/osi/epicsThread.cpp index 02870bed7..4f53eb284 100644 --- a/src/libCom/osi/epicsThread.cpp +++ b/src/libCom/osi/epicsThread.cpp @@ -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 );