summaryrefslogtreecommitdiff
path: root/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'thread.h')
-rw-r--r--thread.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/thread.h b/thread.h
index 6aaee0b..bf9804d 100644
--- a/thread.h
+++ b/thread.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: thread.h 1.4 2000/12/03 11:18:37 kls Exp $
+ * $Id: thread.h 1.6 2001/06/27 11:22:04 kls Exp $
*/
#ifndef __THREAD_H
@@ -16,11 +16,13 @@
class cMutex {
private:
pthread_mutex_t mutex;
+ pid_t lockingPid;
+ int locked;
public:
- cMutex(void) { pthread_mutex_init(&mutex, NULL); }
- ~cMutex() { pthread_mutex_destroy(&mutex); }
- void Lock(void) { pthread_mutex_lock(&mutex); }
- void Unlock(void) { pthread_mutex_unlock(&mutex); }
+ cMutex(void);
+ ~cMutex();
+ void Lock(void);
+ void Unlock(void);
};
class cThread {
@@ -31,6 +33,9 @@ private:
pid_t parentPid, threadPid, lockingPid;
int locked;
bool running;
+ static time_t lastPanic;
+ static int panicLevel;
+ static bool emergencyExitRequested;
static bool signalHandlerInstalled;
static void SignalHandler(int signum);
static void *StartThread(cThread *Thread);
@@ -45,6 +50,8 @@ public:
virtual ~cThread();
bool Start(void);
bool Active(void);
+ static void RaisePanic(void);
+ static bool EmergencyExit(bool Request = false);
};
// cThreadLock can be used to easily set a lock in a thread and make absolutely