Exemple #1
0
 TraceGuard::TraceGuard() :function(NULL) 
 {
   parent = tlParent.get();
   depth = parent == NULL ? 0 : parent->depth + 1;
   tlParent.set(this);
   // silent
 }
Exemple #2
0
 void LanguageHook::clearLanguageHook()
 {
   LanguageHook* lh = addonLanguageHookTls.get();
   addonLanguageHookTls.set(NULL);
   if (lh)
     lh->Release();
 }
Exemple #3
0
  TraceGuard::TraceGuard(const char* _function) :function(_function) 
  {
    parent = tlParent.get();
    depth = parent == NULL ? 0 : parent->depth + 1;

    tlParent.set(this);

    CLog::Log(LOGDEBUG, "%sNEWADDON Entering %s", spaces[depth], function); 
  }
Exemple #4
0
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);
}
Exemple #5
0
CThread* CThread::GetCurrentThread()
{
  return currentThread.get();
}
Exemple #6
0
 LanguageHook* LanguageHook::getLanguageHook()
 {
   return threadLocalInitilialized ? addonLanguageHookTls.get() : NULL;
 }