vdr
2.2.0
|
#include <thread.h>
Public Member Functions | |
cCondWait (void) | |
~cCondWait () | |
bool | Wait (int TimeoutMs=0) |
void | Signal (void) |
Static Public Member Functions | |
static void | SleepMs (int TimeoutMs) |
Private Attributes | |
pthread_mutex_t | mutex |
pthread_cond_t | cond |
bool | signaled |
cCondWait::cCondWait | ( | void | ) |
void cCondWait::Signal | ( | void | ) |
Signals a caller of Wait() that the condition it is waiting for is met.
Definition at line 85 of file thread.c.
References cond, mutex, and signaled.
Referenced by cRingBuffer::EnableGet(), cRingBuffer::EnablePut(), cNonBlockingFileReader::Request(), and cNonBlockingFileReader::~cNonBlockingFileReader().
|
static |
Creates a cCondWait object and uses it to sleep for TimeoutMs milliseconds, immediately giving up the calling thread's time slice and thus avoiding a "busy wait".
In order to avoid a possible busy wait, TimeoutMs will be automatically limited to values >2.
Definition at line 57 of file thread.c.
Referenced by cLircRemote::Action(), cSectionHandler::Action(), cDvbSubtitleConverter::Action(), cTrueColorDemo::Action(), cDvbPlayer::Action(), cCuttingThread::Action(), cDirCopier::Action(), cThread::Cancel(), cIndexFile::cIndexFile(), cPipe::Close(), CutRecording(), cRcuRemote::DetectCode(), GenerateIndex(), cRecordControl::GetEvent(), cLockFile::Lock(), cMenuSetupCAM::Menu(), cInterface::QueryKeys(), cTransfer::Receive(), cDvbSdFfDevice::SetDigitalAudioDevice(), cThread::Start(), cDiseqc::Wait(), cCamSlots::WaitForAllCamSlotsReady(), and cDevice::WaitForAllDevicesReady().
bool cCondWait::Wait | ( | int | TimeoutMs = 0 | ) |
Waits at most TimeoutMs milliseconds for a call to Signal(), or forever if TimeoutMs is 0.
Returns true if Signal() has been called, false it the given timeout has expired.
Definition at line 63 of file thread.c.
References cond, GetAbsTime(), mutex, and signaled.
Referenced by cNonBlockingFileReader::Action(), SleepMs(), cRingBuffer::WaitForGet(), and cRingBuffer::WaitForPut().
|
private |
Definition at line 20 of file thread.h.
Referenced by cCondVar::Broadcast(), cCondVar::cCondVar(), cCondWait(), Signal(), cCondVar::TimedWait(), Wait(), cCondVar::Wait(), cCondVar::~cCondVar(), and ~cCondWait().
|
private |
Definition at line 19 of file thread.h.
Referenced by cIoThrottle::Activate(), cCondWait(), cMutex::cMutex(), cMutexLock::cMutexLock(), cMutex::Lock(), cMutexLock::Lock(), cIoThrottle::Release(), Signal(), cMutex::Unlock(), Wait(), ~cCondWait(), cMutex::~cMutex(), and cMutexLock::~cMutexLock().
|
private |
Definition at line 21 of file thread.h.
Referenced by cCondWait(), Signal(), and Wait().