diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-30 22:17:48 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-30 22:17:48 +0000 |
commit | 0d0bd1642acc24c104e7fbdce193deb165feecf8 (patch) | |
tree | 6c6fe57e0b8d57ff2ebb6576516b7e2d04c7dcff /thread_pthread.c | |
parent | 5ee348fd0e067cf4152df301fedb06517207181b (diff) |
* 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
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/thread_pthread.c b/thread_pthread.c index 5e76e65d6d..0da4aee67f 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -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 @@ thread_timer(void *p) 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; |