mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-21 18:26:06 -05:00
[misc] Centralize thread naming plus name websocket thread
This commit is contained in:
13
src/misc.c
13
src/misc.c
@@ -44,6 +44,9 @@
|
||||
#ifdef HAVE_UUID
|
||||
#include <uuid/uuid.h>
|
||||
#endif
|
||||
#ifdef HAVE_PTHREAD_NP_H
|
||||
# include <pthread_np.h>
|
||||
#endif
|
||||
|
||||
#include <netdb.h>
|
||||
#include <arpa/inet.h>
|
||||
@@ -1545,6 +1548,16 @@ mutex_init(pthread_mutex_t *mutex)
|
||||
return err;
|
||||
}
|
||||
|
||||
void
|
||||
thread_setname(pthread_t thread, const char *name)
|
||||
{
|
||||
#if defined(HAVE_PTHREAD_SETNAME_NP)
|
||||
pthread_setname_np(thread, name);
|
||||
#elif defined(HAVE_PTHREAD_SET_NAME_NP)
|
||||
pthread_set_name_np(thread, name);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAVE_UUID
|
||||
void
|
||||
uuid_make(char *str)
|
||||
|
||||
Reference in New Issue
Block a user