mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
4870feb31a
commit
0148d41a13
3 changed files with 7 additions and 21 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue Jun 28 19:23:01 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* 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 <naruse@ruby-lang.org>
|
||||
|
||||
* lib/benchmark.rb: merge eregon/benchmark.
|
||||
|
|
|
@ -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
|
||||
|
|
21
signal.c
21
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);
|
||||
|
|
Loading…
Add table
Reference in a new issue