vdr  2.2.0
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 17 of file thread.h.

Constructor & Destructor Documentation

cCondWait::cCondWait ( void  )

Definition at line 43 of file thread.c.

References cond, mutex, and signaled.

cCondWait::~cCondWait ( )

Definition at line 50 of file thread.c.

References cond, and mutex.

Member Function Documentation

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().

void cCondWait::SleepMs ( int  TimeoutMs)
static
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().

Member Data Documentation

pthread_cond_t cCondWait::cond
private
pthread_mutex_t cCondWait::mutex
private
bool cCondWait::signaled
private

Definition at line 21 of file thread.h.

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


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