summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-05-29 11:44:52 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-05-29 11:44:52 +0200
commite622406342c6ac1fefec5a3d2800b9c49951ab0d (patch)
tree74c8098cddc17635060fb5015ae1137afc513786
parent961e7a9115e52f1bd85c928a96821222c1022014 (diff)
downloadvdr-e622406342c6ac1fefec5a3d2800b9c49951ab0d.tar.gz
vdr-e622406342c6ac1fefec5a3d2800b9c49951ab0d.tar.bz2
Added cThread::SetPriority() and using it in cSectionHandler::Action() to reduce the priority of the section handler threads1.3.25
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY2
-rw-r--r--sections.c3
-rw-r--r--thread.c8
-rw-r--r--thread.h3
5 files changed, 14 insertions, 3 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 1c0c2020..eff35c7b 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -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 avoiding unnecessary calls to getLength() in libsi/si.c, and avoiding the
'& 0xff' in CRC32::crc32() of libsi/util.c
+ for suggesting to reduce the priority of the section handler threads
diff --git a/HISTORY b/HISTORY
index 81cbefb6..acbad346 100644
--- a/HISTORY
+++ b/HISTORY
@@ -3575,3 +3575,5 @@ Video Disk Recorder Revision History
- Speeded up deleting duplicate channels.
- Fixed listing recordings with empty episode names in the LSTR command (thanks
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).
diff --git a/sections.c b/sections.c
index 7c42a6ef..6552d56e 100644
--- a/sections.c
+++ b/sections.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* 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"
@@ -167,6 +167,7 @@ void cSectionHandler::SetStatus(bool On)
void cSectionHandler::Action(void)
{
active = true;
+ SetPriority(19);
while (active) {
Lock();
diff --git a/thread.c b/thread.c
index 013b2179..9ac1b7ef 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.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"
@@ -208,6 +208,12 @@ cThread::~cThread()
free(description);
}
+void cThread::SetPriority(int Priority)
+{
+ if (setpriority(PRIO_PROCESS, 0, Priority) < 0)
+ LOG_ERROR;
+}
+
void cThread::SetDescription(const char *Description, ...)
{
free(description);
diff --git a/thread.h b/thread.h
index 2c0ebcba..48d04990 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.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
@@ -82,6 +82,7 @@ private:
static bool emergencyExitRequested;
static void *StartThread(cThread *Thread);
protected:
+ void SetPriority(int Priority);
void Lock(void) { mutex.Lock(); }
void Unlock(void) { mutex.Unlock(); }
virtual void Action(void) = 0;