Merge pull request #237 from chme/threadnames

Set thread names
This commit is contained in:
ejurgensen
2016-03-12 17:18:34 +01:00
7 changed files with 59 additions and 6 deletions

View File

@@ -47,6 +47,7 @@
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
# include <netinet/in.h>
# include <pthread_np.h>
#endif
#include "logger.h"
@@ -4919,6 +4920,12 @@ int mpd_init(void)
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;
listener_add(mpd_listener_cb, LISTENER_PLAYER | LISTENER_PLAYLIST | LISTENER_VOLUME | LISTENER_SPEAKER | LISTENER_OPTIONS);