diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2001-08-06 18:00:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2001-08-06 18:00:00 +0200 |
commit | f1d1c9849c8e27cccb46cf9c0d0ccb59da3f91f9 (patch) | |
tree | b5a5f73f7b7595c7371cab1fc11f2ea60aa2b392 /thread.c | |
parent | 8f9cc68f76c4fd0960f919a77fb16a6455922deb (diff) | |
download | vdr-patch-lnbsharing-f1d1c9849c8e27cccb46cf9c0d0ccb59da3f91f9.tar.gz vdr-patch-lnbsharing-f1d1c9849c8e27cccb46cf9c0d0ccb59da3f91f9.tar.bz2 |
Version 0.90vdr-0.90
- Modified the display of the channel group separators (thanks to Markus Lang
for this suggestion).
- Added support for replaying DVDs (thanks to Andreas Schultz). See INSTALL for
instructions on how to compile VDR with DVD support.
- Fixed replay progress display in case replay is paused while watching an
ongoing recording.
- Ringbuffer uses semaphores to signal empty/full conditions.
- Fixed calculating the timeout value in cFile::FileReady() (thanks to
Wolfgang Henselmann-Weiss).
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 39 |
1 files changed, 38 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: thread.c 1.9 2001/06/27 11:34:41 kls Exp $ + * $Id: thread.c 1.11 2001/08/05 10:36:52 kls Exp $ */ #include "thread.h" @@ -14,6 +14,42 @@ #include <unistd.h> #include "tools.h" +// --- cCondVar -------------------------------------------------------------- + +cCondVar::cCondVar(void) +{ + pthread_cond_init(&cond, 0); +} + +cCondVar::~cCondVar() +{ + pthread_cond_destroy(&cond); +} + +bool cCondVar::Wait(cMutex &Mutex) +{ + return pthread_cond_wait(&cond, &Mutex.mutex); +} + +/* +bool cCondVar::TimedWait(cMutex &Mutex, unsigned long tmout) +{ + return pthread_cond_timedwait(&cond, &Mutex.mutex, tmout); +} +*/ + +void cCondVar::Broadcast(void) +{ + pthread_cond_broadcast(&cond); +} + +/* +void cCondVar::Signal(void) +{ + pthread_cond_signal(&cond); +} +*/ + // --- cMutex ---------------------------------------------------------------- cMutex::cMutex(void) @@ -85,6 +121,7 @@ bool cThread::Start(void) running = true; parentPid = getpid(); pthread_create(&thread, NULL, (void *(*) (void *))&StartThread, (void *)this); + pthread_setschedparam(thread, SCHED_RR, 0); usleep(10000); // otherwise calling Active() immediately after Start() causes a "pure virtual method called" error } return true; //XXX return value of pthread_create()??? |