* Reduce the priority of scanner and inotify threads so they don't preempt serving media.

This commit is contained in:
Justin Maggard 2009-03-18 19:28:21 +00:00
parent 06fb334cad
commit 935225e1a3
2 changed files with 11 additions and 1 deletions

View File

@ -7,6 +7,8 @@
#include <libgen.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#ifdef HAVE_INOTIFY_H
#include <sys/inotify.h>
#else
@ -534,7 +536,10 @@ start_inotify()
int length, i = 0;
char * esc_name = NULL;
char * path_buf = NULL;
if (setpriority(PRIO_PROCESS, 0, 15) == -1)
DPRINTF(E_WARN, L_INOTIFY, "Failed to reduce inotify thread priority\n");
fd = inotify_init();
if ( fd < 0 ) {

View File

@ -23,6 +23,8 @@
#include <locale.h>
#include <libgen.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sqlite3.h>
@ -782,6 +784,9 @@ start_scanner()
{
struct media_dir_s * media_path = media_dirs;
if (setpriority(PRIO_PROCESS, 0, 15) == -1)
DPRINTF(E_WARN, L_INOTIFY, "Failed to reduce scanner thread priority\n");
scanning = 1;
freopen("/dev/null", "a", stderr);
while( media_path )