* 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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2011-11-30 22:17:48 +00:00
Родитель 5ee348fd0e
Коммит 0d0bd1642a
3 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Thu Dec 1 07:03:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* 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@ruby-lang.org> Wed Nov 30 23:35:45 2011 NARUSE, Yui <naruse@ruby-lang.org>
* variable.c (rb_path2class): don't raise NameError when the middle * variable.c (rb_path2class): don't raise NameError when the middle

Просмотреть файл

@ -1128,7 +1128,7 @@ AC_CHECK_HEADERS(limits.h sys/file.h sys/ioctl.h sys/syscall.h\
syscall.h pwd.h grp.h a.out.h utime.h direct.h sys/resource.h \ 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 \ 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 \ 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 AC_TYPE_SIZE_T
RUBY_CHECK_SIZEOF(size_t, [int long void*], [], [@%:@include <sys/types.h>]) RUBY_CHECK_SIZEOF(size_t, [int long void*], [], [@%:@include <sys/types.h>])

Просмотреть файл

@ -24,6 +24,9 @@
#elif HAVE_SYS_FCNTL_H #elif HAVE_SYS_FCNTL_H
#include <sys/fcntl.h> #include <sys/fcntl.h>
#endif #endif
#if HAVE_SYS_PRCTL_H
#include <sys/prctl.h>
#endif
static void native_mutex_lock(pthread_mutex_t *lock); static void native_mutex_lock(pthread_mutex_t *lock);
static void native_mutex_unlock(pthread_mutex_t *lock); static void native_mutex_unlock(pthread_mutex_t *lock);
@ -1127,6 +1130,10 @@ thread_timer(void *p)
if (TT_DEBUG) WRITE_CONST(2, "start timer thread\n"); if (TT_DEBUG) WRITE_CONST(2, "start timer thread\n");
#ifdef __linux__
prctl(PR_SET_NAME, "ruby-timer-thr");
#endif
while (system_working > 0) { while (system_working > 0) {
fd_set rfds; fd_set rfds;
int need_polling; int need_polling;