summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-02-23 13:55:57 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2002-02-23 13:55:57 +0100
commitdb7f6ee6192b395682685eb2151fb88354a786b5 (patch)
treedf5a99a045a073c9048cb1eab8b1d4b5eaf22c43 /thread.c
parent645f62fee44496cf4a982c8b7ef24c7a6a4ccc2e (diff)
downloadvdr-db7f6ee6192b395682685eb2151fb88354a786b5.tar.gz
vdr-db7f6ee6192b395682685eb2151fb88354a786b5.tar.bz2
Accessing Schedules data directly via cSIProcessor
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index 4d7fccaf..94ba8605 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.17 2002/02/17 14:47:28 kls Exp $
+ * $Id: thread.c 1.18 2002/02/23 13:49:06 kls Exp $
*/
#include "thread.h"
@@ -190,6 +190,32 @@ bool cThread::EmergencyExit(bool Request)
return emergencyExitRequested = true; // yes, it's an assignment, not a comparison!
}
+// --- cMutexLock ------------------------------------------------------------
+
+cMutexLock::cMutexLock(cMutex *Mutex)
+{
+ mutex = NULL;
+ locked = false;
+ Lock(Mutex);
+}
+
+cMutexLock::~cMutexLock()
+{
+ if (mutex && locked)
+ mutex->Unlock();
+}
+
+bool cMutexLock::Lock(cMutex *Mutex)
+{
+ if (Mutex && !mutex) {
+ mutex = Mutex;
+ Mutex->Lock();
+ locked = true;
+ return true;
+ }
+ return false;
+}
+
// --- cThreadLock -----------------------------------------------------------
cThreadLock::cThreadLock(cThread *Thread)