summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/thread.c b/thread.c
index 52747730..bf5ef6a2 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.46 2005/11/27 15:15:53 kls Exp $
+ * $Id: thread.c 1.47 2005/12/11 12:09:24 kls Exp $
*/
#include "thread.h"
@@ -12,6 +12,7 @@
#include <malloc.h>
#include <stdarg.h>
#include <sys/resource.h>
+#include <sys/syscall.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <unistd.h>
@@ -231,10 +232,10 @@ void cThread::SetDescription(const char *Description, ...)
void *cThread::StartThread(cThread *Thread)
{
if (Thread->description)
- dsyslog("%s thread started (pid=%d, tid=%ld)", Thread->description, getpid(), pthread_self());
+ dsyslog("%s thread started (pid=%d, tid=%d)", Thread->description, getpid(), ThreadId());
Thread->Action();
if (Thread->description)
- dsyslog("%s thread ended (pid=%d, tid=%ld)", Thread->description, getpid(), pthread_self());
+ dsyslog("%s thread ended (pid=%d, tid=%d)", Thread->description, getpid(), ThreadId());
Thread->running = false;
Thread->active = false;
return NULL;
@@ -308,6 +309,13 @@ bool cThread::EmergencyExit(bool Request)
return emergencyExitRequested = true; // yes, it's an assignment, not a comparison!
}
+_syscall0(pid_t, gettid)
+
+tThreadId cThread::ThreadId(void)
+{
+ return gettid();
+}
+
// --- cMutexLock ------------------------------------------------------------
cMutexLock::cMutexLock(cMutex *Mutex)