vdr  2.7.6
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
cCondWait Class Reference

#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
 

Detailed Description

Definition at line 19 of file thread.h.

Constructor & Destructor Documentation

◆ cCondWait()

cCondWait::cCondWait ( void  )

Definition at line 59 of file thread.c.

References cond, mutex, and signaled.

◆ ~cCondWait()

cCondWait::~cCondWait ( )

Definition at line 66 of file thread.c.

References cond, and mutex.

Member Function Documentation

◆ Signal()

void cCondWait::Signal ( void  )

Signals a caller of Wait() that the condition it is waiting for is met.

Definition at line 101 of file thread.c.

References cond, mutex, and signaled.

Referenced by cRingBuffer::EnableGet(), cRingBuffer::EnablePut(), cNonBlockingFileReader::Request(), and cNonBlockingFileReader::~cNonBlockingFileReader().

◆ SleepMs()

void cCondWait::SleepMs ( int  TimeoutMs)
static

◆ Wait()

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 if the given timeout has expired.

Definition at line 79 of file thread.c.

References cond, GetAbsTime(), mutex, and signaled.

Referenced by cNonBlockingFileReader::Action(), SleepMs(), cRingBuffer::WaitForGet(), and cRingBuffer::WaitForPut().

Member Data Documentation

◆ cond

pthread_cond_t cCondWait::cond
private

Definition at line 22 of file thread.h.

Referenced by cCondWait(), Signal(), Wait(), and ~cCondWait().

◆ mutex

pthread_mutex_t cCondWait::mutex
private

Definition at line 21 of file thread.h.

Referenced by cCondWait(), Signal(), Wait(), and ~cCondWait().

◆ signaled

bool cCondWait::signaled
private

Definition at line 23 of file thread.h.

Referenced by cCondWait(), Signal(), and Wait().


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