1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Added cThread::SetPriority() and using it in cSectionHandler::Action() to reduce the priority of the section handler threads

This commit is contained in:
Klaus Schmidinger 2005-05-29 11:44:52 +02:00
parent 961e7a9115
commit e622406342
5 changed files with 14 additions and 3 deletions

View File

@ -1366,3 +1366,4 @@ Georg Acher <acher@baycom.de>
for a patch that was used to implement hash tables to speed up cSchedule::GetEvent() for a patch that was used to implement hash tables to speed up cSchedule::GetEvent()
for avoiding unnecessary calls to getLength() in libsi/si.c, and avoiding the for avoiding unnecessary calls to getLength() in libsi/si.c, and avoiding the
'& 0xff' in CRC32::crc32() of libsi/util.c '& 0xff' in CRC32::crc32() of libsi/util.c
for suggesting to reduce the priority of the section handler threads

View File

@ -3575,3 +3575,5 @@ Video Disk Recorder Revision History
- Speeded up deleting duplicate channels. - Speeded up deleting duplicate channels.
- Fixed listing recordings with empty episode names in the LSTR command (thanks - Fixed listing recordings with empty episode names in the LSTR command (thanks
to Stefan Huelswitt for pointing this out). to Stefan Huelswitt for pointing this out).
- Added cThread::SetPriority() and using it in cSectionHandler::Action() to
reduce the priority of the section handler threads (as suggested by Georg Acher).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: sections.c 1.10 2004/10/24 11:05:12 kls Exp $ * $Id: sections.c 1.11 2005/05/29 11:43:17 kls Exp $
*/ */
#include "sections.h" #include "sections.h"
@ -167,6 +167,7 @@ void cSectionHandler::SetStatus(bool On)
void cSectionHandler::Action(void) void cSectionHandler::Action(void)
{ {
active = true; active = true;
SetPriority(19);
while (active) { while (active) {
Lock(); Lock();

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: thread.c 1.42 2005/05/06 14:39:15 kls Exp $ * $Id: thread.c 1.43 2005/05/29 11:40:30 kls Exp $
*/ */
#include "thread.h" #include "thread.h"
@ -208,6 +208,12 @@ cThread::~cThread()
free(description); free(description);
} }
void cThread::SetPriority(int Priority)
{
if (setpriority(PRIO_PROCESS, 0, Priority) < 0)
LOG_ERROR;
}
void cThread::SetDescription(const char *Description, ...) void cThread::SetDescription(const char *Description, ...)
{ {
free(description); free(description);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: thread.h 1.27 2005/01/14 14:02:14 kls Exp $ * $Id: thread.h 1.28 2005/05/29 11:31:24 kls Exp $
*/ */
#ifndef __THREAD_H #ifndef __THREAD_H
@ -82,6 +82,7 @@ private:
static bool emergencyExitRequested; static bool emergencyExitRequested;
static void *StartThread(cThread *Thread); static void *StartThread(cThread *Thread);
protected: protected:
void SetPriority(int Priority);
void Lock(void) { mutex.Lock(); } void Lock(void) { mutex.Lock(); }
void Unlock(void) { mutex.Unlock(); } void Unlock(void) { mutex.Unlock(); }
virtual void Action(void) = 0; virtual void Action(void) = 0;