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

ruby-changes:21863

From: kosaki <ko1@a...>
Date: Thu, 1 Dec 2011 07:19:17 +0900 (JST)
Subject: [ruby-changes:21863] kosaki:r33912 (trunk): * configure.in: add sys/prctl.h test.

kosaki	2011-12-01 07:17:48 +0900 (Thu, 01 Dec 2011)

  New Revision: 33912

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

  Log:
    * configure.in: add sys/prctl.h test.
    * thread_pthread.c (thread_timer): call prctl(PR_SET_NAME) to change
      thread name. It may help to debug.

  Modified files:
    trunk/ChangeLog
    trunk/configure.in
    trunk/thread_pthread.c

Index: configure.in
===================================================================
--- configure.in	(revision 33911)
+++ configure.in	(revision 33912)
@@ -1128,7 +1128,7 @@
 		 syscall.h pwd.h grp.h a.out.h utime.h direct.h sys/resource.h \
 		 sys/mkdev.h sys/utime.h xti.h netinet/in_systm.h float.h ieeefp.h \
 		 ucontext.h intrinsics.h langinfo.h locale.h sys/sendfile.h time.h \
-		 net/socket.h sys/socket.h process.h)
+		 net/socket.h sys/socket.h process.h sys/prctl.h)
 
 AC_TYPE_SIZE_T
 RUBY_CHECK_SIZEOF(size_t, [int long void*], [], [@%:@include <sys/types.h>])
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33911)
+++ ChangeLog	(revision 33912)
@@ -1,3 +1,9 @@
+Thu Dec  1 07:03:51 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* configure.in: add sys/prctl.h test.
+	* thread_pthread.c (thread_timer): call prctl(PR_SET_NAME) to change
+	  thread name. It may help to debug.
+
 Wed Nov 30 23:35:45 2011  NARUSE, Yui  <naruse@r...>
 
 	* variable.c (rb_path2class): don't raise NameError when the middle
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 33911)
+++ thread_pthread.c	(revision 33912)
@@ -24,6 +24,9 @@
 #elif HAVE_SYS_FCNTL_H
 #include <sys/fcntl.h>
 #endif
+#if HAVE_SYS_PRCTL_H
+#include <sys/prctl.h>
+#endif
 
 static void native_mutex_lock(pthread_mutex_t *lock);
 static void native_mutex_unlock(pthread_mutex_t *lock);
@@ -1127,6 +1130,10 @@
 
     if (TT_DEBUG) WRITE_CONST(2, "start timer thread\n");
 
+#ifdef __linux__
+    prctl(PR_SET_NAME, "ruby-timer-thr");
+#endif
+
     while (system_working > 0) {
 	fd_set rfds;
 	int need_polling;

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

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