void term_handler (int signum) { XbmcCommons::ILogger* logger = CThread::GetLogger(); if (logger) logger->Log(LOGERROR,"thread 0x%lx (%lu) got signal %d. calling OnException and terminating thread abnormally.", (long unsigned int)pthread_self(), (long unsigned int)pthread_self(), signum); CThread* curThread = CThread::GetCurrentThread(); if (curThread) { curThread->StopThread(false); curThread->OnException(); if( curThread->IsAutoDelete() ) delete curThread; } pthread_exit(NULL); }
void CThread::term_handler (int signum) { CLog::Log(LOGERROR,"thread 0x%lx (%lu) got signal %d. calling OnException and terminating thread abnormally.", (long unsigned int)pthread_self(), (long unsigned int)pthread_self(), signum); CThread* curThread = currentThread.get(); if (curThread) { curThread->m_bStop = TRUE; curThread->m_StopEvent.Set(); curThread->OnException(); if( curThread->IsAutoDelete() ) delete curThread; } pthread_exit(NULL); }