From 0148d41a13f0ce7ec5a83f93984fe7aaf9c0e2d2 Mon Sep 17 00:00:00 2001 From: kosaki Date: Tue, 28 Jun 2011 10:42:25 +0000 Subject: [PATCH] * signal.c: Now, USE_TRAP_SIGMASK depend on HAVE_PTHREAD_SIGMASK. The code have already depended on pthread_sigmask since r27464. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ configure.in | 2 +- signal.c | 21 +-------------------- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 65f67b7c6e..0d9fedaa69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jun 28 19:23:01 2011 KOSAKI Motohiro + + * signal.c: Now, USE_TRAP_SIGMASK depend on HAVE_PTHREAD_SIGMASK. + The code have already depended on pthread_sigmask since r27464. + Tue Jun 28 15:09:21 2011 NARUSE, Yui * lib/benchmark.rb: merge eregon/benchmark. diff --git a/configure.in b/configure.in index 0d3d048a76..7f74fd16b3 100644 --- a/configure.in +++ b/configure.in @@ -1750,7 +1750,7 @@ if test x"$enable_pthread" = xyes; then pthread_getattr_np pthread_attr_get_np pthread_attr_getstack\ pthread_get_stackaddr_np pthread_get_stacksize_np \ thr_stksegment pthread_stackseg_np pthread_getthrds_np \ - pthread_condattr_setclock) + pthread_condattr_setclock pthread_sigmask) fi if test x"$ac_cv_header_ucontext_h" = xyes; then if test x"$rb_with_pthread" = xyes; then diff --git a/signal.c b/signal.c index 774cdad303..6c4028e789 100644 --- a/signal.c +++ b/signal.c @@ -32,7 +32,7 @@ ruby_atomic_exchange(rb_atomic_t *ptr, rb_atomic_t val) #undef SIGBUS #endif -#if defined HAVE_SIGPROCMASK || defined HAVE_SIGSETMASK +#ifdef HAVE_PTHREAD_SIGMASK #define USE_TRAP_MASK 1 #else #define USE_TRAP_MASK 0 @@ -520,11 +520,7 @@ rb_signal_buff_size(void) } #if USE_TRAP_MASK -# ifdef HAVE_SIGPROCMASK static sigset_t trap_last_mask; -# else -static int trap_last_mask; -# endif #endif #if HAVE_PTHREAD_H @@ -670,11 +666,7 @@ rb_signal_exec(rb_thread_t *th, int sig) struct trap_arg { #if USE_TRAP_MASK -# ifdef HAVE_SIGPROCMASK sigset_t mask; -# else - int mask; -# endif #endif int sig; sighandler_t func; @@ -854,11 +846,7 @@ trap(struct trap_arg *arg) vm->trap_list[sig].safe = rb_safe_level(); /* enable at least specified signal. */ #if USE_TRAP_MASK -#ifdef HAVE_SIGPROCMASK sigdelset(&arg->mask, sig); -#else - arg->mask &= ~sigmask(sig); -#endif #endif return oldcmd; } @@ -989,16 +977,9 @@ init_sigchld(int sig) { sighandler_t oldfunc; #if USE_TRAP_MASK -# ifdef HAVE_SIGPROCMASK sigset_t mask; sigset_t fullmask; -# else - int mask; - int fullmask; -# endif -#endif -#if USE_TRAP_MASK /* disable interrupt */ sigfillset(&fullmask); pthread_sigmask(SIG_BLOCK, &fullmask, &mask);