* 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 <libgen.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/resource.h>
|
||||||
#ifdef HAVE_INOTIFY_H
|
#ifdef HAVE_INOTIFY_H
|
||||||
#include <sys/inotify.h>
|
#include <sys/inotify.h>
|
||||||
#else
|
#else
|
||||||
@ -535,6 +537,9 @@ start_inotify()
|
|||||||
char * esc_name = NULL;
|
char * esc_name = NULL;
|
||||||
char * path_buf = 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();
|
fd = inotify_init();
|
||||||
|
|
||||||
if ( fd < 0 ) {
|
if ( fd < 0 ) {
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/resource.h>
|
||||||
|
|
||||||
#include <sqlite3.h>
|
#include <sqlite3.h>
|
||||||
|
|
||||||
@ -782,6 +784,9 @@ start_scanner()
|
|||||||
{
|
{
|
||||||
struct media_dir_s * media_path = media_dirs;
|
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;
|
scanning = 1;
|
||||||
freopen("/dev/null", "a", stderr);
|
freopen("/dev/null", "a", stderr);
|
||||||
while( media_path )
|
while( media_path )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user