From 4559e36dc175f0793ed417a25fc44f0dc9516b91 Mon Sep 17 00:00:00 2001 From: Bernhard Froehlich Date: Wed, 8 Jan 2014 14:39:26 +0000 Subject: [PATCH] pthread: Set name of thread for easier debugging on FreeBSD --- src/wrappers.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wrappers.c b/src/wrappers.c index 2f85adc3..cc702aea 100644 --- a/src/wrappers.c +++ b/src/wrappers.c @@ -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 */