Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
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 CJobManager::CJobWorker CJobWorker CLanguageInvokerThread CLibInputHandler CLirc CMediaPipelineWebOS CRssReader CTestBitstreamStatsThread CTestStopWatchThread CTimer CUdpClient CVideoInfoDownloader CVideoPlayer CVideoPlayerAudio CVideoPlayerAudioID3 CVideoPlayerVideo CVideoReferenceClock CWHelper CWin32PowerStateWorker CWinEventsAndroid CWinEventsOSX 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 UPNP::CUPnPPlayer 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)
 
bool SetPriority (const ThreadPriority &priority)
 Set the threads priority. This uses the platforms native threading library to do so.
 
virtual void OnException ()
 

Static Public Member Functions

static const std::thread::id GetCurrentThreadId ()
 
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

◆ 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 ThreadPriority & priority)

Set the threads priority. This uses the platforms native threading library to do so.

◆ 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: