mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Added cThread::SetIOPriority() and using it in cRemoveDeletedRecordingsThread
This commit is contained in:
parent
b36d06e1ea
commit
5b57bdebdc
@ -1070,6 +1070,7 @@ Rolf Ahrenberg <rahrenbe@cc.hut.fi>
|
||||
for setting the thread name, so that it can be seen in 'top -H'
|
||||
for replacing the Finnish language code "smi" with "suo"
|
||||
for adding cap_sys_nice to the capabilities that are not dropped
|
||||
for adding cThread::SetIOPriority() and using it in cRemoveDeletedRecordingsThread
|
||||
|
||||
Ralf Klueber <ralf.klueber@vodafone.com>
|
||||
for reporting a bug in cutting a recording if there is only a single editing mark
|
||||
|
2
HISTORY
2
HISTORY
@ -6039,3 +6039,5 @@ Video Disk Recorder Revision History
|
||||
caused the selected audio and subtitle tracks to fall back to the default.
|
||||
- The SVDRP command PUTE now supports reading the EPG data from a given file
|
||||
(thanks to Helmut Auer).
|
||||
- Added cThread::SetIOPriority() and using it in cRemoveDeletedRecordingsThread
|
||||
(thanks to Rolf Ahrenberg).
|
||||
|
@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: recording.c 2.11 2009/04/13 12:28:36 kls Exp $
|
||||
* $Id: recording.c 2.12 2009/04/13 13:50:39 kls Exp $
|
||||
*/
|
||||
|
||||
#include "recording.h"
|
||||
@ -85,6 +85,7 @@ cRemoveDeletedRecordingsThread::cRemoveDeletedRecordingsThread(void)
|
||||
void cRemoveDeletedRecordingsThread::Action(void)
|
||||
{
|
||||
SetPriority(19);
|
||||
SetIOPriority(7);
|
||||
// Make sure only one instance of VDR does this:
|
||||
cLockFile LockFile(VideoDirectory);
|
||||
if (LockFile.Lock()) {
|
||||
|
8
thread.c
8
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 2.2 2008/09/06 09:39:43 kls Exp $
|
||||
* $Id: thread.c 2.3 2009/04/13 13:50:39 kls Exp $
|
||||
*/
|
||||
|
||||
#include "thread.h"
|
||||
@ -226,6 +226,12 @@ void cThread::SetPriority(int Priority)
|
||||
LOG_ERROR;
|
||||
}
|
||||
|
||||
void cThread::SetIOPriority(int Priority)
|
||||
{
|
||||
if (syscall(SYS_ioprio_set, 1, 0, (Priority & 0xff) | (2 << 13)) < 0) // best effort class
|
||||
LOG_ERROR;
|
||||
}
|
||||
|
||||
void cThread::SetDescription(const char *Description, ...)
|
||||
{
|
||||
free(description);
|
||||
|
3
thread.h
3
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.39 2007/02/24 16:13:28 kls Exp $
|
||||
* $Id: thread.h 2.1 2009/04/13 13:50:39 kls Exp $
|
||||
*/
|
||||
|
||||
#ifndef __THREAD_H
|
||||
@ -87,6 +87,7 @@ private:
|
||||
static void *StartThread(cThread *Thread);
|
||||
protected:
|
||||
void SetPriority(int Priority);
|
||||
void SetIOPriority(int Priority);
|
||||
void Lock(void) { mutex.Lock(); }
|
||||
void Unlock(void) { mutex.Unlock(); }
|
||||
virtual void Action(void) = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user