aboutsummaryrefslogtreecommitdiffstats
path: root/signal.c
Commit message (Collapse)AuthorAgeFilesLines
* * signal.c: Now, USE_TRAP_SIGMASK depend on HAVE_PTHREAD_SIGMASK.kosaki2011-06-281-20/+1
| | | | | | | | 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
* * thread_pthread.c: Stop polling in the timer thread when there areko12011-06-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | no waiting thread. If there are 2 or more runnable threads, the timer thread does polling. Avoid polling makes power save for several computers (0.2W per a Ruby process, when I measured). If outside-event such as signal or Thread#kill was occuerred when the timer thread does not do polling, then wake-up the timer thread using communication-pipe (the timer thread waits this communication-pipe with select(2)). The discussion about this modification can be found from the post [ruby-core:33456] and other related posts. Note that Eric Wong and KOSAKI Motohiro give us the huge contributions for this modification. Thanks. * thread_pthread.c (rb_thread_wakeup_timer_thread): add a function. This function wakes up the timer thread using communication-pipe. * thread.c (rb_thread_stop_timer_thread): add a parameter which specify closing communication-pipe or not. * thread.c (rb_thread_terminate_all): do not stop timer thread here (ruby_cleanup() terminate timer thread). * signal.c: wake up timer thread using rb_thread_wakeup_timer_thread() from signal handler. * eval.c (ruby_cleanup): use rb_thread_stop_timer_thread(1). * process.c: use rb_thread_stop_timer_thread(0) (reuse communication-pipe). * thread_win32.c (rb_thread_wakeup_timer_thread): add a dummy function. * vm_core.h: add and fix decl. of functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c(ruby_atomic_exchange): Fix definement style.sorah2011-06-231-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h (RUBY_VM_SET_TIMER_INTERRUPT, RUBY_VM_SET_INTERRUPT,kosaki2011-06-111-26/+8
| | | | | | | | | | | | | | | RUBY_VM_SET_FINALIZER_INTERRUPT): use atomic ops for preventing interrupt_flag bit lost. * thread.c (rb_threadptr_execute_interrupts_rec): ditto. * vm_core.h (typedef struct rb_thread_struct): change type of interrupt_flag to rb_atomic_t. * atomic.h: move atomic ops definition from signal.c. * signal.c: remove atomic ops definition. * common.mk (gc, signal, thread, cont): add to dependency to atomic.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (Init_signal, default_handler): change default SIGPIPE handlerkosaki2011-05-281-10/+2
| | | | | | | | | from empty function to SIG_IGN. [ruby-dev:43215] * signal.c (sigpipe): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (rb_f_kill): accept '-SIGXXX' style signal with Symbol ornagachika2011-05-151-11/+8
| | | | | | | | implicit convertion with #to_str. [ruby-dev:43169] fixes #4362 * test/ruby/test_signal.rb (test_signal_process_group): add a test for send signal to process group. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.nobu2011-05-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (sig_trap): avoid pthread_sigmask(xx, &mask, &mask) usagekosaki2011-02-191-7/+13
| | | | | | | | | | | because FreeBSD don't permit it. If it's used, it behave as pthread_sigmask(xx, NULL, &mask). * signal.c (init_sigchld): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c: parenthesize macro arguments.akr2010-12-291-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c: change rb_atomic_t definition from uchar to uint.kosaki2010-12-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (ruby_signal): fix condition.nobu2010-11-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (rb_cv_gcc_atomic_builtins): check for atomicnobu2010-10-261-1/+1
| | | | | | builtins, all are not available in Apple derivative gcc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c: fix typo.nobu2010-10-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (rb_atomic_t): GCC (of at least recent versions)shyouhei2010-10-251-0/+11
| | | | | | | | | | | | | | has ubiquitos support for atomic operations. On that compiler a C program can isse a memory barrier using these dedicated instructions. According to the GCC manual they cargo culted this feature form the Itanium ABI so chances are that other compilers could also support this feature. But so far GCC is the only compiler that I know to have it. Also note that this works on non-Itanium machines. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * debug.c (ruby_set_debug_option): define always for binarynobu2010-10-131-8/+6
| | | | | | | | compatibility with debug env enabled binary. * signal.c (ruby_enable_coredump): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.c (rb_thread_struct): add a field for sigaltstack.mame2010-05-131-12/+7
| | | | | | | | | | * thread_pthread.c (thread_start_func_1): initialize machine stack information. * thread.c (thread_start_func_2): set sigaltstack for each sub thread. [ruby-core:24540] [ruby-core:30207] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (ruby_signal_name): rdoc fix for undocumented parametermarcandre2010-04-301-3/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (make_exception, rb_obj_extend): Fix error messages in case of wrongmarcandre2010-04-301-2/+2
| | | | | | | | | | | | | | | | | | | | | number of arguments * file.c (rb_f_test, rb_file_s_umask): ditto * numeric.c (int_chr, num_step): ditto * process.c (rb_f_sleep): ditto * re.c (rb_reg_initialize_m): ditto * signal.c (rb_f_kill, sig_trap): ditto * string.c (rb_str_aref_m, rb_str_aset_m, rb_str_count, rb_str_delete_bang, rb_str_slice_bang, rb_str_sub_bang, str_gsub): ditto * proc.c (curry): rdoc fix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (rb_f_fork): remove after_exec() which sometimes causedmame2010-04-231-26/+5
| | | | | | | | | | two timer threads started. [ruby-core:25217] * signal.c: use pthread_sigmask() instead of sigprocmask(). sigprocmask() is unspecified behavior on multi-thread programs. [ruby-core:25217] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (USE_SIGALTSTACK): NetBSD can't use sigaltstack(2)naruse2010-02-151-1/+1
| | | | | | | with pthread. http://netbsd.gw.com/cgi-bin/man-cgi?sigaltstack++NetBSD-current git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (USE_SIGALTSTACK): only when SA_SIGINFO also isnobu2010-01-251-4/+5
| | | | | | | available. see [ruby-core:27768]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c, file.c, io.c, signal.c: add __HAIKU__.naruse2010-01-251-1/+1
| | | | | | patched by Alexander von Gluck [ruby-core:27767] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_bug_errno): declared.akr2009-11-241-1/+1
| | | | | | | | | | | | | | | | * include/ruby/intern.h (rb_strerrno): declaration removed. * error.c (rb_strerrno): make it static. return NULL for unknown errors. (rb_bug_errno): defined. * thread_pthread.c: use rb_bug_errno. * signal.c (ruby_signal): use rb_bug_errno. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos.akr2009-11-031-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (interrupt_init): nodoc.nobu2009-09-131-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (rb_f_kill): added rdoc about exceptions.nobu2009-09-131-0/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: rename functions which require a parameterko12009-06-081-2/+2
| | | | | | | | | | | | | | | "rb_thread_t *", the prefix to be rb_threadptr_ instead of rb_thread_. * thread.c (rb_thread_add_event_hook(), rb_thread_remove_event_hook): change the parameter type from rb_thread_t * to VALUE. * eval.c, eval_error.c, eval_intern.h, signal.c, vm_core.h, vm_eval.c: ditto. * include/ruby/intern.h: remove decl of rb_thread_signal_raise() and rb_thread_signal_exit(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (sig_trap): suppress warnings.nobu2009-03-101-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (rb_disable_interrupt, rb_enable_interrupt): seenobu2009-02-241-2/+2
| | | | | | | USE_TRAP_MASK. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (register_sigaltstack): ignore sigaltstack error.akr2009-02-061-2/+1
| | | | | | | It fails on OpenBSD 4.4 when pthread library is linked. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (rb_fiber_current), dln.c (dln_print_undef, dln_undefined),nobu2009-02-011-2/+2
| | | | | | | | | | | eval.c (rb_iterator_p, rb_need_block), load.c: (Init_load), ruby.c (uscore_get, rb_f_chop), st.c (stat_col), signal.c (rb_signal_buff_size, ruby_sig_finalize), thread.c (rb_thread_sleep_forever, rb_thread_sleep_deadly, rb_thread_alone): protoized. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (trap_handler): also accepts symbols. [ruby-dev:37823]nobu2009-01-231-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * symbian/README.SYMBIAN: symbian support added. great appreciatematz2009-01-151-3/+3
| | | | | | to <alexandre.zavorine at symbian.com>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (rb_signal_buff_size): defined for check whether signalnaruse2009-01-011-0/+6
| | | | | | | | | is in the buffer or not. * thread_pthread.c (thread_timer): don't exit the loop when signal is in the buffer. [ruby-dev:37637] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/curses/curses.c (window_getch): avoid ISPRINT() macro whichmatz2008-12-041-2/+6
| | | | | | | | has an issue with OpenSolaris. [ruby-core:20189] * signal.c (ruby_signal): EINVAL from sigaction(2) is not a bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (register_sigaltstack): no need to define on non-sigaltstackusa2008-12-011-2/+4
| | | | | | | | platform. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (register_sigaltstack): stores alt stack for debugnobu2008-11-271-14/+10
| | | | | | | purpose. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (ruby_sigaction_t): added.nobu2008-11-271-4/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (ALT_STACK_SIZE): default minimum size is insufficientnobu2008-11-271-2/+2
| | | | | | | for method calls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (ruby_stack_check): no check if using sigaltstack.nobu2008-11-271-4/+15
| | | | | | | | | | | | | | | | * signal.c (register_sigaltstack): minimum size is insufficient for method calls. * signal.c (sigsegv): handles stack overflow if possible. * thread.c (ruby_thread_stack_overflow): helper function to raise sysstack_error. * thread_pthread.c (ruby_stack_overflowed_p): checks for stack overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (register_sigaltstack): should not add externalmatz2008-11-241-8/+10
| | | | | | variable (with some cosmetic changes). [ruby-dev:37158] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (default_handler, Init_signal): compile error ifyugui2008-11-231-0/+4
| | | | | | | USE_SIGALTSTACK is not defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (ALT_STACK_SIZE): 4KB is not enough on Mac OS X.yugui2008-11-231-0/+4
| | | | | | Uses SIGSTKSZ. this fixes [ruby-core:20040]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (register_sigaltstack): use alternative stack formatz2008-11-211-1/+35
| | | | | | | | SIGSEGV to avoid uncaught stack overflow. based on a patch from Hiro Yoshioka <hyoshiok at miraclelinux.com> in [ruby-dev:37134]. [ruby-dev:36993] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (signal_buff): made static. a patch by Tadashi Saitonobu2008-10-241-1/+1
| | | | | | | <shiba AT mail2.accsnet.ne.jp> at [ruby-dev:36915] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c: Ruby no longer supports MacOS 9 or before.yugui2008-10-041-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * eval.c: ditto. * eval_intern.h: ditto. * ext/extmk.rb: ditto. * ext/tk/sample/tkextlib/treectrl/demo.rb: ditto. * ext/tk/stubs.c: ditto. * file.c: ditto. * hash.c: ditto. * include/ruby/defines.h: ditto. * ruby.c: ditto. * signal.c: ditto. * vm_core.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp.yugui2008-10-041-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * djgpp/README.djgpp: ditto. * djgpp/config.hin: ditto. * djgpp/config.sed: ditto. * djgpp/configure.bat: ditto. * djgpp/mkver.sed: ditto. * ext/Setup.dj: ditto. * dln.c: removed djgpp supports. * file.c: ditto. * gc.c: ditto. * io.c: ditto. * process.c: ditto. * ruby.c: ditto. * signal.c: ditto. * util.c: ditto. * vm_core.h: ditto. * lib/fileutils.rb: ditto. * lib/mkmf.rb: ditto. * ext/socket/socket.c: ditto. * test/fileutils/test_fileutils.rb: ditto. * test/ruby/test_env.rb: ditto. * test/ruby/test_path.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/node.h, node.h: move node.h from include path.ko12008-09-231-1/+0
| | | | | | | | | | | | | | This change stop to install node.h beacuase of saving ABI (node.h will be changed. Extensions should not depends on this file). * blockinlining.c, class.c, compile.c, debug.h, enum.c, gc.c, iseq.c, parse.y, ruby.c, signal.c, variable.c, vm.c, vm_core.h, vm_dump.c: ditto. * ext/ripper/depend: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e