aboutsummaryrefslogtreecommitdiffstats
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-11 06:56:57 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-11 06:56:57 +0000
commit51e6b9d6aea533dbe9f9d224864d85588502b3eb (patch)
treef3a1eebfa386b618eb8fba493081d85363dc3590 /thread_pthread.c
parentc002a3c4dd5c6755c2bdde780af44a61a53660c4 (diff)
downloadruby-51e6b9d6aea533dbe9f9d224864d85588502b3eb.tar.gz
* configure.in: define SET_THREAD_NAME if it has pthread_set_name_np
for FreeBSD, and don't define it if both pthread_setname_np and pthread_set_name_np don't exist. * thread_pthread.c (SET_THREAD_NAME): don't define if they don't exist. * thread_pthread.c (native_set_thread_name): run if SET_THREAD_NAME is defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 224da92af4..84228c8c53 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1486,14 +1486,12 @@ timer_thread_sleep(rb_global_vm_lock_t* unused)
#if defined(__linux__) && defined(PR_SET_NAME)
# undef SET_THREAD_NAME
# define SET_THREAD_NAME(name) prctl(PR_SET_NAME, name)
-#elif !defined(SET_THREAD_NAME)
-# define SET_THREAD_NAME(name) (void)0
#endif
static void
native_set_thread_name(rb_thread_t *th)
{
-#if defined(__linux__) && defined(PR_SET_NAME)
+#ifdef SET_THREAD_NAME
if (!th->first_func && th->first_proc) {
VALUE loc = rb_proc_location(th->first_proc);
if (!NIL_P(loc)) {
@@ -1529,7 +1527,9 @@ thread_timer(void *p)
if (TT_DEBUG) WRITE_CONST(2, "start timer thread\n");
+#ifdef SET_THREAD_NAME
SET_THREAD_NAME("ruby-timer-thr");
+#endif
#if !USE_SLEEPY_TIMER_THREAD
native_mutex_initialize(&timer_thread_lock);