vdr
2.4.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 100 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 72 of file thread.c.
Referenced by cLircRemote::Action(), cSectionHandler::Action(), cDvbSubtitleConverter::Action(), cTrueColorDemo::Action(), cCuttingThread::Action(), cDvbPlayer::Action(), cRecordingsHandler::Action(), cTSBuffer::Action(), cDirCopier::Action(), cThread::Cancel(), cIndexFile::cIndexFile(), cPipe::Close(), CutRecording(), GenerateIndex(), cRecordControl::GetEvent(), cLockFile::Lock(), cMenuSetupCAM::Menu(), cCiMMI::Process(), cInterface::QueryKeys(), cTransfer::Receive(), cVideoDirectoryScannerThread::ScanVideoDir(), cThread::Start(), cRecordings::Update(), cDiseqc::Wait(), cCamSlots::WaitForAllCamSlotsReady(), cDevice::WaitForAllDevicesReady(), and cSVDRPServerHandler::WaitUntilReady().
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 78 of file thread.c.
References cond, GetAbsTime(), mutex, and signaled.
Referenced by cNonBlockingFileReader::Action(), SleepMs(), cRingBuffer::WaitForGet(), and cRingBuffer::WaitForPut().
|
private |
Definition at line 22 of file thread.h.
Referenced by cCondWait(), Signal(), Wait(), and ~cCondWait().
|
private |
Definition at line 21 of file thread.h.
Referenced by cCondWait(), Signal(), Wait(), and ~cCondWait().
|
private |
Definition at line 23 of file thread.h.
Referenced by cCondWait(), Signal(), and Wait().