summaryrefslogtreecommitdiff
path: root/thread.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-11-27 15:57:03 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2005-11-27 15:57:03 +0100
commit41f718987d625d2938c6ed0827759b217fda63a2 (patch)
tree4e8c4ac750e83cc9bf49accbc92b5680ac5dd976 /thread.h
parent074de78f0430271e5c6e74057f2fc510b9618ac9 (diff)
downloadvdr-41f718987d625d2938c6ed0827759b217fda63a2.tar.gz
vdr-41f718987d625d2938c6ed0827759b217fda63a2.tar.bz2
Implemented message queueing1.3.37
Diffstat (limited to 'thread.h')
-rw-r--r--thread.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/thread.h b/thread.h
index e72677f3..1b6200ce 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.31 2005/10/09 11:12:32 kls Exp $
+ * $Id: thread.h 1.32 2005/11/27 15:16:50 kls Exp $
*/
#ifndef __THREAD_H
@@ -72,6 +72,8 @@ public:
void Unlock(void);
};
+typedef pthread_t tThreadId;
+
class cThread {
friend class cThreadLock;
private:
@@ -80,6 +82,7 @@ private:
pthread_t childTid;
cMutex mutex;
char *description;
+ static tThreadId mainThreadId;
static bool emergencyExitRequested;
static void *StartThread(cThread *Thread);
protected:
@@ -112,6 +115,8 @@ public:
bool Active(void);
///< Checks whether the thread is still alive.
static bool EmergencyExit(bool Request = false);
+ static tThreadId ThreadId(void) { return pthread_self(); }
+ static tThreadId IsMainThread(void) { return ThreadId() == mainThreadId; }
};
// cMutexLock can be used to easily set a lock on mutex and make absolutely