diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2006-01-03 10:20:41 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2006-01-03 10:20:41 +0100 |
commit | c01259dbb5cf56490de58d6021c9c2fd135d7c66 (patch) | |
tree | 2d850c3d97f7bcdab4f4acaa6a0576ad842a4f40 /thread.c | |
parent | 86197f02060c594f0ec46a64b614215dcb5d28b6 (diff) | |
download | vdr-c01259dbb5cf56490de58d6021c9c2fd135d7c66.tar.gz vdr-c01259dbb5cf56490de58d6021c9c2fd135d7c66.tar.bz2 |
Fixed setting the main thread id if VDR is running as a daemon
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: thread.c 1.48 2006/01/01 14:50:44 kls Exp $ + * $Id: thread.c 1.49 2006/01/03 10:15:54 kls Exp $ */ #include "thread.h" @@ -198,7 +198,7 @@ void cMutex::Unlock(void) // --- cThread --------------------------------------------------------------- -tThreadId cThread::mainThreadId = cThread::ThreadId(); +tThreadId cThread::mainThreadId = 0; bool cThread::emergencyExitRequested = false; cThread::cThread(const char *Description) @@ -320,6 +320,14 @@ tThreadId cThread::ThreadId(void) return gettid(); } +void cThread::SetMainThreadId(void) +{ + if (mainThreadId == 0) + mainThreadId = ThreadId(); + else + esyslog("ERROR: attempt to set main thread id to %d while it already is %d", ThreadId(), mainThreadId); +} + // --- cMutexLock ------------------------------------------------------------ cMutexLock::cMutexLock(cMutex *Mutex) |