mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-09 05:34:58 -05:00
[misc] Centralize thread naming plus name websocket thread
This commit is contained in:
@@ -35,9 +35,6 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/queue.h>
|
||||
#include <pthread.h>
|
||||
#ifdef HAVE_PTHREAD_NP_H
|
||||
# include <pthread_np.h>
|
||||
#endif
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <libspotify/api.h>
|
||||
@@ -1575,11 +1572,7 @@ libspotify_init(void)
|
||||
goto thread_fail;
|
||||
}
|
||||
|
||||
#if defined(HAVE_PTHREAD_SETNAME_NP)
|
||||
pthread_setname_np(tid_spotify, "spotify");
|
||||
#elif defined(HAVE_PTHREAD_SET_NAME_NP)
|
||||
pthread_set_name_np(tid_spotify, "spotify");
|
||||
#endif
|
||||
thread_setname(tid_spotify, "spotify");
|
||||
|
||||
DPRINTF(E_DBG, L_SPOTIFY, "Spotify init complete\n");
|
||||
return 0;
|
||||
|
||||
@@ -45,9 +45,6 @@
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <pthread.h>
|
||||
#ifdef HAVE_PTHREAD_NP_H
|
||||
# include <pthread_np.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/ioctl.h>
|
||||
@@ -854,11 +851,7 @@ pipe_thread_start(void)
|
||||
CHECK_NULL(L_PLAYER, cmdbase = commands_base_new(evbase_pipe, NULL));
|
||||
CHECK_ERR(L_PLAYER, pthread_create(&tid_pipe, NULL, pipe_thread_run, NULL));
|
||||
|
||||
#if defined(HAVE_PTHREAD_SETNAME_NP)
|
||||
pthread_setname_np(tid_pipe, "pipe");
|
||||
#elif defined(HAVE_PTHREAD_SET_NAME_NP)
|
||||
pthread_set_name_np(tid_pipe, "pipe");
|
||||
#endif
|
||||
thread_setname(tid_pipe, "pipe");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -24,9 +24,6 @@
|
||||
#include <stdint.h>
|
||||
#include <fcntl.h>
|
||||
#include <pthread.h>
|
||||
#ifdef HAVE_PTHREAD_NP_H
|
||||
# include <pthread_np.h>
|
||||
#endif
|
||||
|
||||
#include <event2/event.h>
|
||||
|
||||
@@ -229,11 +226,7 @@ tcp_disconnect(int fd)
|
||||
static void
|
||||
thread_name_set(pthread_t thread)
|
||||
{
|
||||
#if defined(HAVE_PTHREAD_SETNAME_NP)
|
||||
pthread_setname_np(thread, "spotify");
|
||||
#elif defined(HAVE_PTHREAD_SET_NAME_NP)
|
||||
pthread_set_name_np(thread, "spotify");
|
||||
#endif
|
||||
thread_setname(thread, "spotify");
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user