Kodi Docs 20.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 CJobWorker CLanguageInvokerThread CLibInputHandler CLirc CRssReader CTestBitstreamStatsThread CTestStopWatchThread CTimer CUdpClient CVideoInfoDownloader CVideoPlayer CVideoPlayerAudio CVideoPlayerVideo CVideoReferenceClock CWHelper CWin32PowerStateWorker CWinEventsAndroid CWinEventsTVOS CZeroconfMDNS EVENTSERVER::CEventServer JSONRPC::CTCPServer KODI::GAME::CControllerInstaller KODI::GAME::CControllerSelect KODI::GAME::CGUIConfigurationWizard KODI::GAME::CGUIDialogButtonCapture KODI::JOYSTICK::CGUIDialogNewJoystick KODI::JOYSTICK::CRumbleGenerator KODI::MESSAGING::CDelayedMessage KODI::RETRO::CGameLoop KODI::RETRO::CRetroPlayerAutoSave MUSIC_GRABBER::CMusicInfoScraper PAPlayer PERIPHERALS::CEventScanner PERIPHERALS::CPeripheralBus PVR::CPVREpgContainer PVR::CPVRGUIInfo PVR::CPVRGUIProgressHandler PVR::CPVRManager PVR::CPVRRefreshTimelineItemsThread PVR::CPVRTimers VAAPI::COutput VDPAU::CMixer VDPAU::COutput WSDiscovery::CWSDiscoveryListenerUDP XFILE::CFileCache XFILE::CShoutcastFile

Public Member Functions

 CThread (IRunnable *pRunnable, const char *ThreadName)
 
virtual ~CThread ()
 
void Create (bool bAutoDelete=false)
 
template<typename Rep , typename Period >
void Sleep (std::chrono::duration< Rep, Period > duration)
 
bool IsAutoDelete () const
 
virtual void StopThread (bool bWait=true)
 
bool IsRunning () const
 
bool IsCurrentThread () const
 
bool Join (std::chrono::milliseconds duration)
 
int GetPriority (void)
 
bool SetPriority (const int iPriority)
 
virtual void OnException ()
 

Static Public Member Functions

static const std::thread::id GetCurrentThreadId ()
 
static int GetMinPriority (void)
 
static int GetMaxPriority (void)
 
static int GetNormalPriority (void)
 
static std::uintptr_t GetCurrentThreadNativeHandle ()
 
static uint64_t GetCurrentThreadNativeId ()
 
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, std::chrono::milliseconds duration=std::chrono::milliseconds(-1))
 

Protected Attributes

std::atomic< boolm_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,
std::chrono::milliseconds  duration = std::chrono::milliseconds(-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)

◆ GetCurrentThread()

CThread * CThread::GetCurrentThread ( )
static

◆ GetCurrentThreadId()

static const std::thread::id CThread::GetCurrentThreadId ( )
inlinestatic

◆ GetCurrentThreadNativeHandle()

std::uintptr_t CThread::GetCurrentThreadNativeHandle ( )
static

◆ GetCurrentThreadNativeId()

uint64_t CThread::GetCurrentThreadNativeId ( )
static

◆ GetMaxPriority()

int CThread::GetMaxPriority ( void  )
static

◆ GetMinPriority()

int CThread::GetMinPriority ( void  )
static

◆ GetNormalPriority()

int CThread::GetNormalPriority ( void  )
static

◆ GetPriority()

int CThread::GetPriority ( void  )

◆ IsAutoDelete()

bool CThread::IsAutoDelete ( ) const

◆ IsCurrentThread()

bool CThread::IsCurrentThread ( ) const

◆ IsRunning()

bool CThread::IsRunning ( ) const

◆ Join()

bool CThread::Join ( std::chrono::milliseconds  duration)

◆ OnException()

virtual void CThread::OnException ( )
inlinevirtual

Reimplemented in CLanguageInvokerThread.

◆ OnExit()

◆ OnStartup()

◆ Process()

◆ SetPriority()

bool CThread::SetPriority ( const int  iPriority)

◆ Sleep()

template<typename Rep , typename Period >
void CThread::Sleep ( std::chrono::duration< Rep, Period >  duration)
inline

◆ StopThread()

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

Reimplemented in XFILE::CFileCache.

Member Data Documentation

◆ m_bStop

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

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