summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2000-10-29 13:17:22 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2000-10-29 13:17:22 +0100
commite6999e9b3a5f584de2f40ca833effe5ff5636f6a (patch)
treeffbbe5fd379916a43e9c887783b34ee34563a77f /thread.c
parent92d3e366badb370e446156c0896103a578a24af0 (diff)
downloadvdr-e6999e9b3a5f584de2f40ca833effe5ff5636f6a.tar.gz
vdr-e6999e9b3a5f584de2f40ca833effe5ff5636f6a.tar.bz2
Implemented 'Schedules' menu
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/thread.c b/thread.c
index 7304e682..b124581f 100644
--- a/thread.c
+++ b/thread.c
@@ -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;