From 92ca9f0696738fae28c50ab05d553946bc49cc96 Mon Sep 17 00:00:00 2001 From: naruse Date: Sat, 13 Jun 2015 08:49:10 +0000 Subject: darwin can't set anothre thread's name git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/thread.c b/thread.c index aedf73a102..5218ba7262 100644 --- a/thread.c +++ b/thread.c @@ -2748,18 +2748,6 @@ rb_thread_setname(VALUE thread, VALUE name) pthread_setname_np(th->thread_id, RSTRING_PTR(name)); # elif defined(__NetBSD__) pthread_setname_np(th->thread_id, RSTRING_PTR(name), "%s"); -#elif defined(__APPLE__) - { - int mib[2] = {CTL_KERN, KERN_THREADNAME}; - int r; -# ifndef MAXTHREADNAMESIZE -# define MAXTHREADNAMESIZE 64 -# endif - int size_t len = RSTRING_LEN(name); - if (len > MAXTHREADNAMESIZE-1) len = MAXTHREADNAMESIZE-1; - r = sysctl(mib, 2, NULL, 0, RSTRING_PTR(name), len); - if (!r) rb_sys_fail("sysctl([CTL_KERN, KERN_THREADNAME],..)"); - } # endif #elif defined(HAVE_PTHREAD_SET_NAME_NP) /* FreeBSD */ pthread_set_name_np(th->thread_id, RSTRING_PTR(name)); -- cgit v1.2.3