ruby-changes:33786
From: nagachika <ko1@a...>
Date: Thu, 8 May 2014 01:21:13 +0900 (JST)
Subject: [ruby-changes:33786] nagachika:r45867 (ruby_2_1): merge revision(s) r45190, r45202, r45204, r45713: [Backport #9586]
nagachika 2014-05-08 01:21:02 +0900 (Thu, 08 May 2014) New Revision: 45867 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45867 Log: 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] Modified directories: branches/ruby_2_1/ Modified files: branches/ruby_2_1/ChangeLog branches/ruby_2_1/configure.in branches/ruby_2_1/thread_pthread.c branches/ruby_2_1/version.h Index: ruby_2_1/configure.in =================================================================== --- ruby_2_1/configure.in (revision 45866) +++ ruby_2_1/configure.in (revision 45867) @@ -2454,6 +2454,36 @@ if test x"$enable_pthread" = xyes; then https://github.com/ruby/ruby/blob/trunk/ruby_2_1/configure.in#L2454 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 Index: ruby_2_1/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 45866) +++ ruby_2_1/ChangeLog (revision 45867) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Thu May 8 01:13:10 2014 NARUSE, Yui <naruse@r...> + + * configure.in: correct pthread_setname_np's prototype on NetBSD. + [Bug #9586] + Tue May 6 00:54:56 2014 Narihiro Nakamura <authornari@g...> * gc.c (gc_after_sweep): suppress unnecessary expanding heap. Index: ruby_2_1/thread_pthread.c =================================================================== --- ruby_2_1/thread_pthread.c (revision 45866) +++ ruby_2_1/thread_pthread.c (revision 45867) @@ -1422,11 +1422,9 @@ timer_thread_sleep(rb_global_vm_lock_t* https://github.com/ruby/ruby/blob/trunk/ruby_2_1/thread_pthread.c#L1422 #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 Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 45866) +++ ruby_2_1/version.h (revision 45867) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #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 Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r45190,45202,45204,45713 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/