[前][次][番号順一覧][スレッド一覧]

ruby-changes:38784

From: naruse <ko1@a...>
Date: Sat, 13 Jun 2015 17:49:26 +0900 (JST)
Subject: [ruby-changes:38784] naruse:r50865 (trunk): darwin can't set anothre thread's name

naruse	2015-06-13 17:49:10 +0900 (Sat, 13 Jun 2015)

  New Revision: 50865

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50865

  Log:
    darwin can't set anothre thread's name

  Modified files:
    trunk/thread.c
Index: thread.c
===================================================================
--- thread.c	(revision 50864)
+++ thread.c	(revision 50865)
@@ -2748,18 +2748,6 @@ rb_thread_setname(VALUE thread, VALUE na https://github.com/ruby/ruby/blob/trunk/thread.c#L2748
     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));

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]