mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-12 23:01:44 -05:00
Set thread names to make it easier to identify threads during debugging
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
# include <sys/time.h>
|
||||
# include <sys/event.h>
|
||||
# include <pthread_np.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
@@ -2313,6 +2314,12 @@ filescanner_init(void)
|
||||
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;
|
||||
|
||||
thread_fail:
|
||||
|
||||
Reference in New Issue
Block a user