]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
pthread: Set name of thread for easier debugging on FreeBSD
authorBernhard Froehlich <decke@bluelife.at>
Wed, 8 Jan 2014 14:39:26 +0000 (14:39 +0000)
committerBernhard Froehlich <decke@bluelife.at>
Wed, 8 Jan 2014 14:39:26 +0000 (14:39 +0000)
src/wrappers.c

index 2f85adc38747fb83c9321236f884c13e421aaf5e..cc702aea6194345b6676dff95e5e1c5287998ba0 100644 (file)
@@ -97,9 +97,12 @@ thread_wrapper ( void *p )
 {
   struct thread_state *ts = p;
 
-#ifdef PLATFORM_LINUX
+#if defined(PLATFORM_LINUX)
   /* Set name */
   prctl(PR_SET_NAME, ts->name);
+#elif defined(PLATFORM_FREEBSD)
+  /* Set name of thread */
+  pthread_set_name_np(pthread_self(), ts->name);
 #endif
 
   /* Run */