diff --git a/src/libCom/osi/epicsThread.cpp b/src/libCom/osi/epicsThread.cpp index 149e26cb7..02870bed7 100644 --- a/src/libCom/osi/epicsThread.cpp +++ b/src/libCom/osi/epicsThread.cpp @@ -14,7 +14,6 @@ #include #include -#include #include #include @@ -32,23 +31,6 @@ epicsThreadRunable::~epicsThreadRunable () {} void epicsThreadRunable::run () {} void epicsThreadRunable::show ( unsigned int ) const {} -// vxWorks 5.4 gcc fails during compile when I use std::exception -using namespace std; - -// exception payload -class epicsThread::unableToCreateThread : public exception { - const char * what () const throw () { - return "epicsThread class was unable to create a new thread"; - } -}; - -// exception payload -class epicsThread::exitException : public exception { - const char * what () const throw () { - return "epicsThread class's private exit exception"; - } -}; - extern "C" void epicsThreadCallEntryPoint ( void * pPvt ) { epicsThread * pThread = @@ -78,7 +60,7 @@ extern "C" void epicsThreadCallEntryPoint ( void * pPvt ) // 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. - unexpected (); + std::unexpected (); } } catch ( ... ) { @@ -94,7 +76,7 @@ extern "C" void epicsThreadCallEntryPoint ( void * pPvt ) // 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. - unexpected (); + std::unexpected (); } } if ( ! waitRelease ) { @@ -284,13 +266,6 @@ void epicsThread::setOkToBlock(bool isOkToBlock) throw () epicsThreadSetOkToBlock(static_cast(isOkToBlock)); } -class epicsThreadPrivateBase::unableToCreateThreadPrivate : public exception { - const char * what () const throw () - { - return "epicsThreadPrivate:: unable to create thread private variable"; - } -}; - void epicsThreadPrivateBase::throwUnableToCreateThreadPrivate () { throw epicsThreadPrivateBase::unableToCreateThreadPrivate (); @@ -335,4 +310,4 @@ extern "C" { } // extern "C" // Ensure the main thread gets a unique ID -static epicsThreadId epicsThreadMainId = epicsThreadGetIdSelf(); +epicsThreadId epicsThreadMainId = epicsThreadGetIdSelf(); diff --git a/src/libCom/osi/epicsThread.h b/src/libCom/osi/epicsThread.h index 17073a3ae..015bc2f1c 100644 --- a/src/libCom/osi/epicsThread.h +++ b/src/libCom/osi/epicsThread.h @@ -156,7 +156,9 @@ public: static const char * getNameSelf () throw (); static bool isOkToBlock () throw (); static void setOkToBlock ( bool isOkToBlock ) throw (); - class unableToCreateThread; /* exception payload */ + + /* exceptions */ + class unableToCreateThread {}; private: epicsThreadRunable & runable; epicsThreadId id; @@ -173,12 +175,13 @@ private: epicsThread & operator = ( const epicsThread & ); friend void epicsThreadCallEntryPoint ( void * ); - class exitException; /* exception payload */ + /* exceptions */ + class exitException {}; }; class epicsShareClass epicsThreadPrivateBase { public: - class unableToCreateThreadPrivate; /* exception */ + class unableToCreateThreadPrivate {}; /* exception */ protected: static void throwUnableToCreateThreadPrivate (); };