8000 merge revision(s) r45190,r45202,r45204,r45713: [Backport #9586] · github/ruby@b0a974d · GitHub
[go: up one dir, main page]

Skip to content

Commit b0a974d

Browse files
committed
merge revision(s) r45190,r45202,r45204,r45713: [Backport ruby#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 ruby#9586] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@45867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent dfaab03 commit b0a974d

File tree

4 files changed

+38
-5
lines changed

4 files changed

+38
-5
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Thu May 8 01:13:10 2014 NARUSE, Yui <naruse@ruby-lang.org>
2+
3+
* configure.in: correct pthread_setname_np's prototype on NetBSD.
4+
[Bug #9586]
5+
16
Tue May 6 00:54:56 2014 Narihiro Nakamura <authornari@gmail.com>
27

38
* gc.c (gc_after_sweep): suppress unnecessary expanding heap.

configure.in

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2454,6 +2454,36 @@ if test x"$enable_pthread" = xyes; then
24542454
else
24552455
AC_CHECK_FUNCS(pthread_attr_init)
24562456
fi
2457+
if test "$ac_cv_func_pthread_setname_np" = yes; then
2458+
AC_CACHE_CHECK([arguments of pthread_setname_np], [rb_cv_func_pthread_setname_np_arguments],
2459+
[rb_cv_func_pthread_setname_np_arguments=
2460+
# Linux,AIX, (pthread_self(), name)
2461+
# NetBSD (pthread_self(), name, \"%s\")
2462+
# Darwin (name)
2463+
for mac in \
2464+
"(pthread_self(), name)" \
2465+
"(pthread_self(), name, \"%s\")" \
2466+
"(name)" \
2467+
; do
2468+
AC_TRY_COMPILE([
2469+
@%:@include <pthread.h>
2470+
@%:@ifdef HAVE_PTHREAD_NP_H
2471+
@%:@include <pthread_np.h>
2472+
@%:@endif
2473+
@%:@define SET_THREAD_NAME(name) pthread_setname_np${mac}
2474+
],
2475+
[if (SET_THREAD_NAME("conftest")) return 1;],
2476+
[rb_cv_func_pthread_setname_np_arguments="${mac}"
2477+
break])
2478+
done
2479+
]
2480+
)
2481+
if test -n "${rb_cv_func_pthread_setname_np_arguments}"; then
2482+
AC_DEFINE_UNQUOTED(SET_THREAD_NAME(name), pthread_setname_np${rb_cv_func_pthread_setname_np_arguments})
2483+
else
2484+
AC_DEFINE_UNQUOTED(SET_THREAD_NAME(name), (void)0)
2485+
fi
2486+
fi
24572487
fi
24582488
if test x"$ac_cv_header_ucontext_h" = xyes; then
24592489
if test x"$rb_with_pthread" = xyes; then

thread_pthread.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,11 +1422,9 @@ timer_thread_sleep(rb_global_vm_lock_t* unused)
14221422
#endif /* USE_SLEEPY_TIMER_THREAD */
14231423

14241424
#if defined(__linux__) && defined(PR_SET_NAME)
1425+
# undef SET_THREAD_NAME
14251426
# define SET_THREAD_NAME(name) prctl(PR_SET_NAME, name)
1426-
#elif defined(HAVE_PTHREAD_SETNAME_NP)
1427-
/* pthread_setname_np() on Darwin does not have target thread argument */
1428-
# define SET_THREAD_NAME(name) pthread_setname_np(name)
1429-
#else
1427+
#elif !defined(SET_THREAD_NAME)
14301428
# define SET_THREAD_NAME(name) (void)0
14311429
#endif
14321430

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.1.2"
22
#define RUBY_RELEASE_DATE "2014-05-08"
3-
#define RUBY_PATCHLEVEL 94
3+
#define RUBY_PATCHLEVEL 95
44

55
#define RUBY_RELEASE_YEAR 2014
66
#define RUBY_RELEASE_MONTH 5

0 commit comments

Comments
 (0)
0