diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2004-11-21 18:00:00 +0100 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2004-11-21 18:00:00 +0100 |
commit | 630ba21dc198e3fbf8c15c59f7ea852f7174c476 (patch) | |
tree | e22596d33f241fb414204c962c004c605a838a1b /thread.c | |
parent | 23ed5a5ed3824b01cbf66699ff0b34f72ddb9826 (diff) | |
download | vdr-patch-lnbsharing-630ba21dc198e3fbf8c15c59f7ea852f7174c476.tar.gz vdr-patch-lnbsharing-630ba21dc198e3fbf8c15c59f7ea852f7174c476.tar.bz2 |
Version 1.3.17vdr-1.3.17
- Fixed cRemux::ScanVideoPacket() to make sure it doesn't access memory beyond
the end of the given buffer, which has caused some unjustified "unknown
picture type errors" (thanks to Marco Schlüßler).
- Fixed a possible crash when pausing live video and the recording was unable
to start, maybe because there was no lock on the device (thanks to Andreas
Brugger for reporting this one).
- Fixed some characters in the iso8859-2 font file (thanks to Dino Ravnic).
- Fixed some errors in the Croatian language texts (thanks to Dino Ravnic).
- Fixed a possible recursion in cControl::Shutdown() (thanks to Sascha Volkenandt).
- Now setting the VPID before the APID in live mode to avoid unnecessary
overhead in the firmware (thanks to Werner Fink).
- Now checking available OSD memory at runtime (thanks to Oliver Endriss).
- Fixed some typos in the Makefile's 'font' target (thanks to Olaf Titz).
- Fixed handling childTid in cThread to avoid possible race conditions (thanks
to Stefan Huelswitt for pointing this out).
- Fixed toggling the "Day" item in the "Timers" menu, so that it selects the
right day of week for timers in the future.
- Some improvements to cPoller (thanks to Marco Schlüßler).
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 13 |
1 files changed, 9 insertions, 4 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.36 2004/10/31 09:54:02 kls Exp $ + * $Id: thread.c 1.37 2004/11/20 16:21:14 kls Exp $ */ #include "thread.h" @@ -233,12 +233,15 @@ void *cThread::StartThread(cThread *Thread) bool cThread::Start(void) { + Lock(); if (!childTid) { parentTid = pthread_self(); - pthread_create(&childTid, NULL, (void *(*) (void *))&StartThread, (void *)this); - pthread_detach(childTid); // auto-reap - pthread_setschedparam(childTid, SCHED_RR, 0); + pthread_t Tid; + pthread_create(&Tid, NULL, (void *(*) (void *))&StartThread, (void *)this); + pthread_detach(Tid); // auto-reap + pthread_setschedparam(Tid, SCHED_RR, 0); } + Unlock(); return true; //XXX return value of pthread_create()??? } @@ -277,10 +280,12 @@ void cThread::Cancel(int WaitSeconds) } esyslog("ERROR: thread %ld won't end (waited %d seconds) - cancelling it...", childTid, WaitSeconds); } + Lock(); if (childTid) { pthread_cancel(childTid); childTid = 0; } + Unlock(); } } |