mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-31 09:43:45 -04:00
commit
abce1d0eeb
@ -30,6 +30,9 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
# include <pthread_np.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <event2/event.h>
|
#include <event2/event.h>
|
||||||
|
|
||||||
@ -1848,6 +1851,12 @@ cache_init(void)
|
|||||||
goto thread_fail;
|
goto thread_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__linux__)
|
||||||
|
pthread_setname_np(tid_cache, "cache");
|
||||||
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
pthread_set_name_np(tid_cache, "cache");
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
thread_fail:
|
thread_fail:
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
# include <sys/event.h>
|
# include <sys/event.h>
|
||||||
|
# include <pthread_np.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_REGEX_H
|
#ifdef HAVE_REGEX_H
|
||||||
@ -2313,6 +2314,12 @@ filescanner_init(void)
|
|||||||
goto thread_fail;
|
goto thread_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__linux__)
|
||||||
|
pthread_setname_np(tid_scan, "filescanner");
|
||||||
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
pthread_set_name_np(tid_scan, "filescanner");
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
thread_fail:
|
thread_fail:
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
# include <pthread_np.h>
|
||||||
|
#endif
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
@ -1394,6 +1397,12 @@ httpd_init(void)
|
|||||||
goto thread_fail;
|
goto thread_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__linux__)
|
||||||
|
pthread_setname_np(tid_httpd, "httpd");
|
||||||
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
pthread_set_name_np(tid_httpd, "httpd");
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
thread_fail:
|
thread_fail:
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
|
|
||||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
# include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
|
# include <pthread_np.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
@ -4919,6 +4920,12 @@ int mpd_init(void)
|
|||||||
goto thread_fail;
|
goto thread_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__linux__)
|
||||||
|
pthread_setname_np(tid_mpd, "mpd");
|
||||||
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
pthread_set_name_np(tid_mpd, "mpd");
|
||||||
|
#endif
|
||||||
|
|
||||||
idle_clients = NULL;
|
idle_clients = NULL;
|
||||||
listener_add(mpd_listener_cb, LISTENER_PLAYER | LISTENER_PLAYLIST | LISTENER_VOLUME | LISTENER_SPEAKER | LISTENER_OPTIONS);
|
listener_add(mpd_listener_cb, LISTENER_PLAYER | LISTENER_PLAYLIST | LISTENER_VOLUME | LISTENER_SPEAKER | LISTENER_OPTIONS);
|
||||||
|
|
||||||
|
15
src/player.c
15
src/player.c
@ -36,6 +36,7 @@
|
|||||||
# include <sys/timerfd.h>
|
# include <sys/timerfd.h>
|
||||||
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
# include <signal.h>
|
# include <signal.h>
|
||||||
|
# include <pthread_np.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <event2/event.h>
|
#include <event2/event.h>
|
||||||
@ -3386,9 +3387,7 @@ playerqueue_add(struct player_command *cmd)
|
|||||||
queue_shuffle(queue, cur_id);
|
queue_shuffle(queue, cur_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO [refactor] Unnecessary if, always set plid to 0 after adding items
|
cur_plid = 0;
|
||||||
if (cur_plid != 0)
|
|
||||||
cur_plid = 0;
|
|
||||||
cur_plversion++;
|
cur_plversion++;
|
||||||
|
|
||||||
listener_notify(LISTENER_PLAYLIST);
|
listener_notify(LISTENER_PLAYLIST);
|
||||||
@ -3411,9 +3410,7 @@ playerqueue_add_next(struct player_command *cmd)
|
|||||||
if (shuffle)
|
if (shuffle)
|
||||||
queue_shuffle(queue, cur_id);
|
queue_shuffle(queue, cur_id);
|
||||||
|
|
||||||
//TODO [refactor] Unnecessary if, always set plid to 0 after adding items
|
cur_plid = 0;
|
||||||
if (cur_plid != 0)
|
|
||||||
cur_plid = 0;
|
|
||||||
cur_plversion++;
|
cur_plversion++;
|
||||||
|
|
||||||
listener_notify(LISTENER_PLAYLIST);
|
listener_notify(LISTENER_PLAYLIST);
|
||||||
@ -4731,6 +4728,12 @@ player_init(void)
|
|||||||
DPRINTF(E_FATAL, L_PLAYER, "Could not spawn player thread: %s\n", strerror(errno));
|
DPRINTF(E_FATAL, L_PLAYER, "Could not spawn player thread: %s\n", strerror(errno));
|
||||||
goto thread_fail;
|
goto thread_fail;
|
||||||
}
|
}
|
||||||
|
#if defined(__linux__)
|
||||||
|
pthread_setname_np(tid_player, "player");
|
||||||
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
pthread_set_name_np(tid_player, "player");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -37,6 +37,9 @@
|
|||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
# include <pthread_np.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <libspotify/api.h>
|
#include <libspotify/api.h>
|
||||||
@ -2296,6 +2299,12 @@ spotify_init(void)
|
|||||||
goto thread_fail;
|
goto thread_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__linux__)
|
||||||
|
pthread_setname_np(tid_spotify, "spotify");
|
||||||
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
pthread_set_name_np(tid_spotify, "spotify");
|
||||||
|
#endif
|
||||||
|
|
||||||
DPRINTF(E_DBG, L_SPOTIFY, "Spotify init complete\n");
|
DPRINTF(E_DBG, L_SPOTIFY, "Spotify init complete\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -30,6 +30,9 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
# include <pthread_np.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <event2/event.h>
|
#include <event2/event.h>
|
||||||
|
|
||||||
@ -332,6 +335,12 @@ worker_init(void)
|
|||||||
goto thread_fail;
|
goto thread_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__linux__)
|
||||||
|
pthread_setname_np(tid_worker, "worker");
|
||||||
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
pthread_set_name_np(tid_worker, "worker");
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
thread_fail:
|
thread_fail:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user