diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2000-10-29 13:17:22 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2000-10-29 13:17:22 +0100 |
commit | e6999e9b3a5f584de2f40ca833effe5ff5636f6a (patch) | |
tree | ffbbe5fd379916a43e9c887783b34ee34563a77f /thread.c | |
parent | 92d3e366badb370e446156c0896103a578a24af0 (diff) | |
download | vdr-e6999e9b3a5f584de2f40ca833effe5ff5636f6a.tar.gz vdr-e6999e9b3a5f584de2f40ca833effe5ff5636f6a.tar.bz2 |
Implemented 'Schedules' menu
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 19 |
1 files changed, 15 insertions, 4 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.2 2000/10/08 16:45:50 kls Exp $ + * $Id: thread.c 1.3 2000/10/28 15:26:02 kls Exp $ */ #include "thread.h" @@ -88,16 +88,27 @@ void cThread::WakeUp(void) cThreadLock::cThreadLock(cThread *Thread) { - thread = Thread; - locked = Thread->Lock(); + thread = NULL; + locked = false; + Lock(Thread); } cThreadLock::~cThreadLock() { - if (locked) + if (thread && locked) thread->Unlock(); } +bool cThreadLock::Lock(cThread *Thread) +{ + if (Thread && !thread) { + thread = Thread; + locked = Thread->Lock(); + return locked; + } + return false; +} + bool cThreadLock::Locked(void) { return locked; |