StarupThread::StarupThread(void)
{
- m_exception = false;
- m_success = 0;
}
StarupThread::~StarupThread(void)
}
//-------------------------------------
-// Thread entry point
-//-------------------------------------
-
-void StarupThread::run(void)
-{
- m_exception = false;
- m_success = 0;
- runChecked1(this, m_success, &m_exception);
-}
-
-void StarupThread::runChecked1(StarupThread *const thread, volatile int &success, volatile bool *exception)
-{
- __try
- {
- return runChecked2(thread, success, exception);
- }
- __except(1)
- {
- *exception = true;
- qWarning("Unhandled exception error in startup thread !!!");
- }
-}
-
-void StarupThread::runChecked2(StarupThread *const thread, volatile int &success, volatile bool *exception)
-{
- try
- {
- success = thread->threadMain();
- }
- catch(...)
- {
- *exception = true;
- qWarning("Startup thread raised an C++ exception!");
- }
-}
-
-//-------------------------------------
// Utility functions
//-------------------------------------