mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
merge revision(s) r45190,r45202,r45204,r45713: [Backport #9586]
configure.in: define SET_THREAD_NAME * configure.in (SET_THREAD_NAME): define according to pthread_setname_np variations. * configure.in: correct pthread_setname_np's prototype on NetBSD. [Bug #9586] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@45867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b494603551
commit
65b76d92a4
4 changed files with 38 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu May 8 01:13:10 2014 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* configure.in: correct pthread_setname_np's prototype on NetBSD.
|
||||
[Bug #9586]
|
||||
|
||||
Tue May 6 00:54:56 2014 Narihiro Nakamura <authornari@gmail.com>
|
||||
|
||||
* gc.c (gc_after_sweep): suppress unnecessary expanding heap.
|
||||
|
|
30
configure.in
30
configure.in
|
@ -2454,6 +2454,36 @@ if test x"$enable_pthread" = xyes; then
|
|||
else
|
||||
AC_CHECK_FUNCS(pthread_attr_init)
|
||||
fi
|
||||
if test "$ac_cv_func_pthread_setname_np" = yes; then
|
||||
AC_CACHE_CHECK([arguments of pthread_setname_np], [rb_cv_func_pthread_setname_np_arguments],
|
||||
[rb_cv_func_pthread_setname_np_arguments=
|
||||
# Linux,AIX, (pthread_self(), name)
|
||||
# NetBSD (pthread_self(), name, \"%s\")
|
||||
# Darwin (name)
|
||||
for mac in \
|
||||
"(pthread_self(), name)" \
|
||||
"(pthread_self(), name, \"%s\")" \
|
||||
"(name)" \
|
||||
; do
|
||||
AC_TRY_COMPILE([
|
||||
@%:@include <pthread.h>
|
||||
@%:@ifdef HAVE_PTHREAD_NP_H
|
||||
@%:@include <pthread_np.h>
|
||||
@%:@endif
|
||||
@%:@define SET_THREAD_NAME(name) pthread_setname_np${mac}
|
||||
],
|
||||
[if (SET_THREAD_NAME("conftest")) return 1;],
|
||||
[rb_cv_func_pthread_setname_np_arguments="${mac}"
|
||||
break])
|
||||
done
|
||||
]
|
||||
)
|
||||
if test -n "${rb_cv_func_pthread_setname_np_arguments}"; then
|
||||
AC_DEFINE_UNQUOTED(SET_THREAD_NAME(name), pthread_setname_np${rb_cv_func_pthread_setname_np_arguments})
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(SET_THREAD_NAME(name), (void)0)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test x"$ac_cv_header_ucontext_h" = xyes; then
|
||||
if test x"$rb_with_pthread" = xyes; then
|
||||
|
|
|
@ -1422,11 +1422,9 @@ timer_thread_sleep(rb_global_vm_lock_t* unused)
|
|||
#endif /* USE_SLEEPY_TIMER_THREAD */
|
||||
|
||||
#if defined(__linux__) && defined(PR_SET_NAME)
|
||||
# undef SET_THREAD_NAME
|
||||
# define SET_THREAD_NAME(name) prctl(PR_SET_NAME, name)
|
||||
#elif defined(HAVE_PTHREAD_SETNAME_NP)
|
||||
/* pthread_setname_np() on Darwin does not have target thread argument */
|
||||
# define SET_THREAD_NAME(name) pthread_setname_np(name)
|
||||
#else
|
||||
#elif !defined(SET_THREAD_NAME)
|
||||
# define SET_THREAD_NAME(name) (void)0
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define RUBY_VERSION "2.1.2"
|
||||
#define RUBY_RELEASE_DATE "2014-05-08"
|
||||
#define RUBY_PATCHLEVEL 94
|
||||
#define RUBY_PATCHLEVEL 95
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2014
|
||||
#define RUBY_RELEASE_MONTH 5
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue