Home

Dokumentation

Impressum

Dokumentation VDR
 

Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

cThread Class Reference

#include <thread.h>

Inheritance diagram for cThread:

Inheritance graph
[legend]
Collaboration diagram for cThread:

Collaboration graph
[legend]

Detailed Description

Simple thread based class.

Definition at line 47 of file thread.h.

Public Methods

 cThread (void)
virtual ~cThread ()
bool Start (void)
bool Active (void)

Static Public Methods

void RaisePanic (void)
bool EmergencyExit (bool Request=false)

Protected Methods

void Lock (void)
void Unlock (void)
void WakeUp (void)
virtual void Action (void)=0
void Cancel (int WaitSeconds=0)

Static Private Methods

void SignalHandler (int signum)
void * StartThread (cThread *Thread)

Private Attributes

pthread_t thread
cMutex mutex
pid_t parentPid
pid_t threadPid
bool running

Static Private Attributes

time_t lastPanic = 0
int panicLevel = 0
bool emergencyExitRequested = false
bool signalHandlerInstalled = false

Friends

class cThreadLock


Constructor & Destructor Documentation

cThread::cThread void   
 

Definition at line 122 of file thread.c.

References parentPid, running, signalHandlerInstalled, and threadPid.

cThread::~cThread   [virtual]
 

Definition at line 132 of file thread.c.


Member Function Documentation

virtual void cThread::Action void    [protected, pure virtual]
 

Implemented in cCuttingThread, cDevice, cDvbTuner, cDvbPlayer, cSIProcessor, cLircRemote, cRcuRemote, cRecorder, cKbdRemote, and cTransfer.

Referenced by StartThread().

bool cThread::Active void   
 

Reimplemented in cDvbPlayer.

Definition at line 160 of file thread.c.

References LOG_ERROR, and threadPid.

Referenced by cCutter::Active(), Cancel(), and cCutter::Stop().

void cThread::Cancel int    WaitSeconds = 0 [protected]
 

Definition at line 175 of file thread.c.

References Active(), esyslog, and running.

Referenced by cTransfer::Activate(), cRecorder::Activate(), cDvbPlayer::Activate(), cDevice::Detach(), cCuttingThread::~cCuttingThread(), cDvbTuner::~cDvbTuner(), cKbdRemote::~cKbdRemote(), cLircRemote::~cLircRemote(), cRcuRemote::~cRcuRemote(), and cSIProcessor::~cSIProcessor().

bool cThread::EmergencyExit bool    Request = false [static]
 

Definition at line 213 of file thread.c.

References emergencyExitRequested, and esyslog.

Referenced by cDevice::Action(), main(), cRemux::Process(), RaisePanic(), cMenuSetup::Restart(), and cRecordControls::Start().

void cThread::Lock void    [inline, protected]
 

Definition at line 61 of file thread.h.

References cMutex::Lock().

Referenced by cDevice::Action(), cDevice::AttachReceiver(), cDevice::Detach(), cDvbPlayer::Empty(), and cThreadLock::Lock().

void cThread::RaisePanic void    [static]
 

Definition at line 196 of file thread.c.

References dsyslog, EmergencyExit(), esyslog, lastPanic, MAXPANICLEVEL, and panicLevel.

void cThread::SignalHandler int    signum [static, private]
 

Definition at line 136 of file thread.c.

bool cThread::Start void   
 

Definition at line 148 of file thread.c.

References parentPid, and running.

Referenced by cTransfer::Activate(), cRecorder::Activate(), cDvbPlayer::Activate(), cDevice::AttachReceiver(), cCuttingThread::cCuttingThread(), cDvbTuner::cDvbTuner(), cKbdRemote::cKbdRemote(), cLircRemote::cLircRemote(), cRcuRemote::cRcuRemote(), and cSIProcessor::cSIProcessor().

void * cThread::StartThread cThread *    Thread [static, private]
 

Definition at line 141 of file thread.c.

References Action(), and threadPid.

void cThread::Unlock void    [inline, protected]
 

Definition at line 62 of file thread.h.

References cMutex::Unlock().

Referenced by cDevice::Action(), cDevice::AttachReceiver(), cDevice::Detach(), cDvbPlayer::Empty(), and cThreadLock::~cThreadLock().

void cThread::WakeUp void    [protected]
 

Definition at line 189 of file thread.c.


Friends And Related Function Documentation

friend class cThreadLock [friend]
 

Definition at line 48 of file thread.h.


Field Documentation

bool cThread::emergencyExitRequested = false [static, private]
 

Definition at line 120 of file thread.c.

Referenced by EmergencyExit().

time_t cThread::lastPanic = 0 [static, private]
 

Definition at line 117 of file thread.c.

Referenced by RaisePanic().

cMutex cThread::mutex [private]
 

Reimplemented in cDvbTuner.

Definition at line 51 of file thread.h.

int cThread::panicLevel = 0 [static, private]
 

Definition at line 118 of file thread.c.

Referenced by RaisePanic().

pid_t cThread::parentPid [private]
 

Definition at line 52 of file thread.h.

Referenced by cThread(), and Start().

bool cThread::running [private]
 

Reimplemented in cDvbPlayer.

Definition at line 53 of file thread.h.

Referenced by Cancel(), cThread(), and Start().

bool cThread::signalHandlerInstalled = false [static, private]
 

Definition at line 119 of file thread.c.

Referenced by cThread().

pthread_t cThread::thread [private]
 

Definition at line 50 of file thread.h.

pid_t cThread::threadPid [private]
 

Definition at line 52 of file thread.h.

Referenced by Active(), cThread(), and StartThread().


The documentation for this class was generated from the following files:
Generated on Wed Feb 5 23:31:59 2003 for VDR by doxygen1.3-rc2