Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
CThread Class Reference

#include <Thread.h>

Inheritance diagram for CThread:
ADDON::CAddonStatusHandler ANNOUNCEMENT::CAnnouncementManager ActiveAE::CActiveAE ActiveAE::CActiveAESink CAirPlayServer CAirTunesServer CAlarmClock CBackgroundPicLoader CBusyWaiter CDVDRadioRDSData CDVDTeletextData CExternalPlayer CFDEventMonitor CGUIDialogCache CGUIDialogKeyboardTouch CIRServerSuite CInputCodingTableBaiduPY CJobWorker CLanguageInvokerThread CLibInputHandler CLirc COMXImage CRssReader CTestBitstreamStatsThread CTestStopWatchThread CTimer CUdpClient CVideoInfoDownloader CVideoPlayer CVideoPlayerAudio CVideoPlayerVideo CVideoReferenceClock CWHelper CWin32PowerStateWorker CWinEventsAndroid CZeroconfMDNS EVENTSERVER::CEventServer JSONRPC::CTCPServer KODI::GAME::CControllerInstaller KODI::GAME::CGUIConfigurationWizard KODI::GAME::CGUIDialogButtonCapture KODI::JOYSTICK::CGUIDialogNewJoystick KODI::JOYSTICK::CRumbleGenerator KODI::MESSAGING::CDelayedMessage KODI::RETRO::CGameLoop KODI::RETRO::CRetroPlayerAutoSave MMAL::CMMALRenderer MUSIC_GRABBER::CMusicInfoScraper OMXPlayerAudio OMXPlayerVideo PAPlayer PERIPHERALS::CEventScanner PERIPHERALS::CPeripheralBus PVR::CPVREpgContainer PVR::CPVRGUIInfo PVR::CPVRGUIProgressHandler PVR::CPVRManager PVR::CPVRRefreshTimelineItemsThread VAAPI::COutput VDPAU::CMixer VDPAU::COutput XFILE::CFileCache XFILE::CShoutcastFile

Public Member Functions

 CThread (IRunnable *pRunnable, const char *ThreadName)
 
virtual ~CThread ()
 
void Create (bool bAutoDelete=false, unsigned stacksize=0)
 
void Sleep (unsigned int milliseconds)
 
int GetSchedRRPriority (void)
 
bool SetPrioritySched_RR (int iPriority)
 
bool IsAutoDelete () const
 
virtual void StopThread (bool bWait=true)
 
bool IsRunning () const
 
bool IsCurrentThread () const
 
int GetMinPriority (void)
 
int GetMaxPriority (void)
 
int GetNormalPriority (void)
 
int GetPriority (void)
 
bool SetPriority (const int iPriority)
 
bool WaitForThreadExit (unsigned int milliseconds)
 
float GetRelativeUsage ()
 
int64_t GetAbsoluteUsage ()
 
virtual void OnException ()
 

Static Public Member Functions

static bool IsCurrentThread (const ThreadIdentifier tid)
 
static ThreadIdentifier GetCurrentThreadId ()
 
static ThreadIdentifier GetDisplayThreadId (const ThreadIdentifier tid)
 
static CThreadGetCurrentThread ()
 

Protected Types

enum  WaitResponse { WAIT_INTERRUPTED = -1 , WAIT_SIGNALED = 0 , WAIT_TIMEDOUT = 1 }
 

Protected Member Functions

 CThread (const char *ThreadName)
 
virtual void OnStartup ()
 
virtual void OnExit ()
 
virtual void Process ()
 
WaitResponse AbortableWait (CEvent &event, int timeoutMillis=-1)
 

Protected Attributes

std::atomic< bool > m_bStop
 

Member Enumeration Documentation

◆ WaitResponse

enum CThread::WaitResponse
protected
Enumerator
WAIT_INTERRUPTED 
WAIT_SIGNALED 
WAIT_TIMEDOUT 

Constructor & Destructor Documentation

◆ CThread() [1/2]

CThread::CThread ( const char *  ThreadName)
explicitprotected

◆ CThread() [2/2]

CThread::CThread ( IRunnable pRunnable,
const char *  ThreadName 
)

◆ ~CThread()

CThread::~CThread ( )
virtual

Member Function Documentation

◆ AbortableWait()

WaitResponse CThread::AbortableWait ( CEvent event,
int  timeoutMillis = -1 
)
inlineprotected

This call will wait on a CEvent in an interruptible way such that if stop is called on the thread the wait will return with a response indicating what happened.

◆ Create()

void CThread::Create ( bool  bAutoDelete = false,
unsigned  stacksize = 0 
)

◆ GetAbsoluteUsage()

int64_t CThread::GetAbsoluteUsage ( )

◆ GetCurrentThread()

CThread * CThread::GetCurrentThread ( )
static

◆ GetCurrentThreadId()

ThreadIdentifier CThread::GetCurrentThreadId ( )
static

◆ GetDisplayThreadId()

ThreadIdentifier CThread::GetDisplayThreadId ( const ThreadIdentifier  tid)
static

◆ GetMaxPriority()

int CThread::GetMaxPriority ( void  )

◆ GetMinPriority()

int CThread::GetMinPriority ( void  )

◆ GetNormalPriority()

int CThread::GetNormalPriority ( void  )

◆ GetPriority()

int CThread::GetPriority ( void  )

◆ GetRelativeUsage()

float CThread::GetRelativeUsage ( )

◆ GetSchedRRPriority()

int CThread::GetSchedRRPriority ( void  )

◆ IsAutoDelete()

bool CThread::IsAutoDelete ( ) const

◆ IsCurrentThread() [1/2]

bool CThread::IsCurrentThread ( ) const

◆ IsCurrentThread() [2/2]

bool CThread::IsCurrentThread ( const ThreadIdentifier  tid)
static

◆ IsRunning()

bool CThread::IsRunning ( ) const

◆ OnException()

virtual void CThread::OnException ( )
inlinevirtual

Reimplemented in CLanguageInvokerThread.

◆ OnExit()

◆ OnStartup()

◆ Process()

◆ SetPriority()

bool CThread::SetPriority ( const int  iPriority)

◆ SetPrioritySched_RR()

bool CThread::SetPrioritySched_RR ( int  iPriority)

◆ Sleep()

void CThread::Sleep ( unsigned int  milliseconds)

◆ StopThread()

void CThread::StopThread ( bool  bWait = true)
virtual

Reimplemented in XFILE::CFileCache.

◆ WaitForThreadExit()

bool CThread::WaitForThreadExit ( unsigned int  milliseconds)

Member Data Documentation

◆ m_bStop

std::atomic<bool> CThread::m_bStop
protected

The documentation for this class was generated from the following files: