* Reduce the priority of scanner and inotify threads so they don't preempt serving media.
This commit is contained in:
parent
06fb334cad
commit
935225e1a3
@ -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 ) {
|
||||
|
@ -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 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user