Set thread names to make it easier to identify threads during debugging

This commit is contained in:
chme
2016-03-05 13:19:55 +01:00
parent 9a5b67031e
commit 98d6db002f
7 changed files with 57 additions and 0 deletions

View File

@@ -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: