aboutsummaryrefslogtreecommitdiffstats
path: root/signal.c
Commit message (Collapse)AuthorAgeFilesLines
* * signal.c: need to include unistd.h for write(2).usa2013-05-141-0/+3
| | | | | | | | unistd.h is now included via ruby/defines.h, but should implicitly include here. (suggested by kosaki) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (rb_f_kill): fixes typo. s/HAS_KILLPG/HAVE_KILLPG/.kosaki2013-05-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fixed comment typo by @qqshfox [fix GH-279]hsbt2013-04-091-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* envutil.rb: signal in Process::Statusnobu2013-03-251-3/+3
| | | | | | | | | | | * test/ruby/envutil.rb (assert_ruby_status): show status info. * test/ruby/envutil.rb (Test::Unit::Assertions::FailDesc): use Signal.signame for consistency with Process::Status#inspect. * signal.c (siglist): prefer SIGABRT over SIGIOT in Signal.signame. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: added a declaration of ruby_kill().kosaki2013-03-191-2/+4
| | | | | | | | | | | | | | | | | | | | * thread.c (ruby_kill): helper function of kill(). * signal.c (rb_f_kill): use ruby_kill() instead of kill(). * signal.c (rb_f_kill): call rb_thread_execute_interrupts() to ensure that make SignalException if sent a signal to myself. [Bug #7951] [ruby-core:52864] * vm_core.h (typedef struct rb_thread_struct): added th->interrupt_cond. * thread.c (rb_threadptr_interrupt_common): added to initialization of th->interrupt_cond. * thread.c (thread_create_core): ditto. * test/ruby/test_signal.rb (TestSignal#test_hup_me): test for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: fix typenobu2013-02-241-1/+1
| | | | | | * signal.c (sigsegv): type of write(2) is ssize_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (sigsegv): suppress unused result warning. Becausekosaki2013-02-241-1/+3
| | | | | | write(2) is marked __warn_unused_result__ on Linux glibc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (ruby_abort): fix typo in r39354 [Bug #5014]ngoto2013-02-221-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c: extract check_stack_overflownobu2013-02-211-15/+20
| | | | | | | * signal.c (check_stack_overflow): extract duplicated code and get rid of declaration-after-statement. [Bug #5014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (sigsegv): avoid to use async signal unsafe functionskosaki2013-02-211-10/+25
| | | | | | | when nested sigsegv is happen. [Bug #5014] [ruby-dev:44082] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: rename methods:ko12012-12-231-1/+1
| | | | | | | | | | | | | | | | | | from Thread.async_interrupt_timing to Thread.handle_interrupt, from Thread.async_interrupted? to Thread.pending_interrupt?. Also rename option from `defer' to `never'. [ruby-core:51074] [ruby-trunk - Feature #6762] * vm_core.c, thread.c: rename functions and data structure `async_errinfo' to `pending_interrupt'. * thread.c: add global variables sym_immediate, sym_on_blocking and sym_never. * cont.c, process.c, vm.c, signal.c: ditto. * lib/sync.rb, lib/thread.rb: catch up this renaming. * test/ruby/test_thread.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (rb_sigaltstack_size): cast sysconf() return valuekosaki2012-12-151-1/+1
| | | | | | explicitly. Fix compile error on Mac OS X. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (default_handler): remove rb_register_sigaltstack()kosaki2012-12-151-3/+0
| | | | | | call. sigaltstack was already registered when creating threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (rb_sigaltstack_size): new. calculate stack size forkosaki2012-12-151-1/+22
| | | | | | | | | | | | | | | sigsegv handler. enlarge value when x86 or x86_64 on Linux. Linux has very small MINSIGSTKSZ size (2048 bytes) and our sigsegv routine need 5KiB at least. [Bug #7141] * internal.h: add declaration of rb_sigaltstack_size(). * vm_core.h: remove ALT_STACK_SIZE definition. * signal.c (rb_register_sigaltstack): replace ALT_STACK_SIZE with rb_sigaltstack_size(); * gc.c (Init_heap): ditto. * vm.c (th_init): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (rb_f_kill): remove rb_thread_polling() because thiskosaki2012-12-141-1/+0
| | | | | | | | | | | | has no good effect and makes meaningless 100ms delay. 1) when sending signal to another process, waiting has just silly. 2) when sending signal to current process, 100ms is often not enough time to wait. It depend on kernel behavior. And, rb_thread_polling() doesn't make sense anyway. When rb_thread_alone() is true, it doesn't wait at all and Process.kill() users don't expect threading changes Process.kill() behavior. [Bug #7560] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* adjust style.nobu2012-12-011-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby_atomic.h (ATOMIC_CAS): added for Solaris and other platforms.ngoto2012-11-271-1/+12
| | | | | | | | | | | * ruby_atomic.h, signal.c (NEED_RUBY_ATOMIC_OPS): renamed from NEED_RUBY_ATOMIC_EXCHANGE. * signal.c (ruby_atomic_compare_and_swap): naive, non-atomic compare-and-swap implementation only used for platforms without valid support for atomic operations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h (RUBY_VM_SET_TIMER_INTERRUPT, RUBY_VM_SET_INTERRUPT)kosaki2012-11-261-1/+1
| | | | | | | | | (RUBY_VM_SET_FINALIZER_INTERRUPT, RUBY_VM_SET_TRAP_INTERRUPT) (RUBY_VM_INTERRUPTED): use enum symbol instead of immediate value. * thread.c (thread_join_m, rb_threadptr_execute_interrupts): ditto. * signal.c (signal_exec): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thread_join_m): use th->interrupt_mask instead ofkosaki2012-11-261-3/+0
| | | | | | | | | | | th->in_trap. * vm_core.h (struct rb_thread_struct): remove in_trap member. * signal.c (signal_exec): ditto. * thread.c (thread_create_core): ditto. * thread.c (Init_Thread): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby_atomic.h (ATOMIC_CAS): new macro for compare-and-exchange.kosaki2012-11-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | * vm_core.h (struct rb_thread_struct): add interrupt_mask member. * thread.c (thread_create_core, Init_Thread): initialize th->thread_mask. * vm_core.h (RUBY_VM_INTERRUPTED_ANY): new macro for avoiding bare th->interrupt_flag. * vm_core.h (RUBY_VM_INTERRUPTED, RUBY_VM_INTERRUPTED): check th->interrupt_mask. * thread.c (set_unblock_function, rb_thread_schedule): replace th->interrupt_flag with RUBY_VM_INTERRUPTED_ANY() * signal.c (signal_exec): set up thread->interrupt_mask for preventing recursive trap handler. * vm_core.h (RUBY_VM_CHECK_INTS, RUBY_VM_CHECK_INTS_BLOCKING): ditto. * thread.c (rb_threadptr_execute_interrupts): don't process interrupt if it is masked. [Bug #6009] [ruby-core:42524] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (signal_exec): add volatile to make sure setjmp safe.kosaki2012-11-261-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (signal_exec): suppress "warning: variable 'signum'kosaki2012-11-261-1/+1
| | | | | | might be clobbered by 'longjmp' or 'vfork'" warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h (rb_thread_struct): added 'in_trap' member for markingkosaki2012-11-261-1/+17
| | | | | | | | | | | | | running trap handler. * signal.c (signal_exec): turn on in_trap when running trap. * thread.c (Init_Thread, thread_create_core): initialize in_trap when creating new threads. * thread.c (thread_join_m): raise ThreadError when running trap handler.Bug [#6416][ruby-core:44956] * test/ruby/test_thread.rb (test_thread_join_in_trap): new test for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (rb_get_next_signal): removed pointless signalkosaki2012-11-191-6/+2
| | | | | | | | | disabling. pthread_sigmask() only changes current thread mask. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (install_sighandler): added comments why we needkosaki2012-11-191-0/+2
| | | | | | | | rb_disable_interrupt(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (rb_disable_interrupt, rb_enable_interrupt): removedkosaki2012-11-191-57/+24
| | | | | | | | | | | | USE_TRAP_MASK. * signal.c (trap_arg, trap_ensure): removed. * signal.c (trap, sig_trap): removed pointless signal disabling. We don't need it bacause we no longer run trap hander on signal hander context. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (sig_signame): implements Signal.signame methodkosaki2012-11-191-0/+21
| | | | | | | | | | [Feature #5613] * test/ruby/test_signal.rb (test_signame): adds test for above * NEWS: add an item about above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby_atomic.h: renamed from atomic.h to avoid header file name conflictngoto2012-11-091-1/+1
| | | | | | | | | on Solaris 10. [ruby-dev:46414] [Bug #7287] * gc.c, signal.c, vm_core.h, common.mk: reflect the rename from atomic.h to ruby_atomic.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (rb_f_kill):zzak2012-09-131-5/+5
| | | | | | | | Update documentation for Process.kill to reflect kill(2) Patch by Richo Healey git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: Fixing Haiku build.naruse2012-08-231-1/+5
| | | | | | | | | | | - -lbe is not required for linking - stack protector doesn't work for now because of the default gcc's bug by Takashi Toyoshima <toyoshim@gmail.com> https://github.com/ruby/ruby/pull/167 * signal.c (ruby_signal): haiku doesn't have SIGBUS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c: Simplify and make consistent an ifdef for Mac OS X.kosaki2012-07-091-1/+1
| | | | | | | | | | | * ext/socket/rubysocket.h: ditto. * ext/tk/stubs.c: ditto. * io.c: ditto. * process.c: ditto. * signal.c: ditto. * vm_dump.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Imports Ruby's port to NativeClient (a.k.a NaCl).yugui2012-05-171-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Google Inc. [ruby-core:45073]. * configure.in (RUBY_NACL): New M4 func to configure variables for NaCl. (RUBY_NACL_CHECK_PEPPER_TYPES): New M4 func to check the old names of Pepper interface types. (BTESTRUBY): New variable to specify which ruby should be run on "make btest". NaCl can run the built binary by sel_ldr, but it need rbconfig.rb. So this variable is distinguished from $MINIRUBY. * thread_pthread.c: Disabled some features on NaCl. * io.c: ditto. * process.c: ditto. * signal.c: ditto. * file.c: ditto. * missing/flock.c: ditto. * nacl/pepper_main.c: An example implementation of Pepper application that embeds Ruby. * nacl/example.html: An example of web page that uses the Pepper application. * nacl/nacl-config.rb: Detects variants of NaCl SDK. * nacl/GNUmakefile.in: Makefile template for NaCl specific build process. * nacl/package.rb: script for packaging a NaCl-Ruby embedding application. * nacl/reate_nmf.rb: Wrapper script of create_nmf.py * dln.c (dln_load): Added a hack to call on NaCl. * util.c (ruby_getcwd): Path to the current directort is not available on NaCl. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]marcandre2012-03-141-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * array.c: Use rb_check_arity / rb_error_arity * class.c: ditto * enumerator.c: ditto * eval.c: ditto * file.c: ditto * hash.c: ditto * numeric.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * re.c: ditto * signal.c: ditto * string.c: ditto * struct.c: ditto * transcode.c: ditto * vm_eval.c: ditto * vm_insnhelper.c: ditto & implementation of rb_error_arity * test/ruby/test_arity.rb: tests for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (sig_trap): show signal name on error.akr2012-02-231-1/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (big_rshift), compile.c (validate_label,nobu2011-12-051-0/+1
| | | | | | | | | | | | | | iseq_build_from_ary_exception), cont.c (cont_capture), dir.c (dir_open_dir), gc.c (objspace_each_objects), io.c (pipe_open) (rb_io_advise), parse.y (parser_compile_string) (rb_parser_compile_file), proc.c (binding_free), process.c (rb_proc_exec_n, rb_seteuid_core, proc_setegid, rb_setegid_core) (p_uid_exchange, p_gid_exchange), regparse.c (strdup_with_null), signal.c (sig_dfl), vm.c (rb_iseq_eval, rb_iseq_eval_main), vm_insnhelper.c (vm_expandarray): suppress unused-but-set-variable warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (reserved_signal_p): static.nobu2011-12-051-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * atomic.h (ATOMIC_INC, ATOMIC_DEC): return old values.nobu2011-10-131-1/+1
| | | | | | | | [ruby-dev:44596] [Bug #5439] * signal.c (ruby_atomic_exchange): no needs to define on the platforms where atomic.h is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (th_init): preallocate alternative stack.kosaki2011-07-301-11/+4
| | | | | | | | | | | | | | NoMemoryError is better than rb_bug, of course. Patch by Eric Wong. [ruby-core:38572][ruby-core:38594]. * signal.c (rb_register_sigaltstack): ditto. * vm_core.h: moved ALT_STACK_SIZE definition from signal.c. * vm.c (thread_free): use xfree() instead of free(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (reserved_signal_p): reverted a part of r32523.kosaki2011-07-121-10/+0
| | | | | | | | | | chikanaga noticed trap(:CHLD) has some realworld usecase. * test/ruby/test_signal.rb (TestSignal#test_reserved_signal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* small cleanupkosaki2011-07-121-18/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (install_sighandler): fixed a race.kosaki2011-07-121-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (sig_trap): don't permit to change a signal handler whichkosaki2011-07-121-0/+43
| | | | | | | | | | | | | the interpreter reserved. * signal.c (reserved_signal_p): ditto. [Bug #2616] [ruby-core:27625] * test/ruby/test_signal.rb (TestSignal#test_reserved_signal): added a test for reserved signal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread_pthread.c (rb_thread_create_timer_thread): removedkosaki2011-07-101-19/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | rb_disable_interrupt()/rb_enable_interrupt(). * vm_core.h: ditto. * process.c (static void before_exec): ditto. * process.c (static void after_exec): ditto. [Bug #4765] [ruby-dev:43571] * eval_intern.h: removed rb_trap_restore_mask(). * vm_eval.c (rb_throw_obj): ditto. * eval.c (setup_exception): ditto. * signal.c: removed trap_last_mask. * signal.c (trap_restore_mask): removed. * signal.c (init_sigchld): comment clarification why signal block is needed. and removed trap_last_mask operation. * signal.c (trap_ensure): removed trap_last_mask operation. * signal.c (rb_disable_interrupt, rb_enable_interrupt): made static and removed sigdelset(SIGVTALARM) and sigdelset(SIGSEGV). * process.c (rb_syswait): removed implicit signal handler change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (sigsegv): use abort() instead of exit() when nestedkosaki2011-07-101-1/+1
| | | | | | | | SEGV was happen. Because unnested SEGV use abort(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread_pthread.c (get_stack): add to a care of gurad page on Mackosaki2011-07-021-4/+17
| | | | | | | | | | | | | OS X. [Bug #1813] [ruby-core:24540] * signal.c (ruby_signal): SIGBUS use alternative stack too. * signal.c (sigbus): On Mac, thread stack overflow makes SIGBUS instead of SIGSEGV. thus, added stackoverflow check. * signal.c (default_handler): get rid of compilation warning. * signal.c (Init_signal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_threadptr_check_signal): only wake up main thread.ko12011-06-301-9/+11
| | | | | | | | | | | | | | | | | * thread.c (rb_threadptr_execute_interrupts_common): check signal deliverly if it is main thread. fixes [ruby-dev:44005] [Ruby 1.9 - Bug #4950] * bootstraptest/test_fork.rb: add a test for above. * signal.c (rb_get_next_signal): skip if signal_buff is empty. (check signal_buff.size first) * vm_core.h: remove unused variable rb_thread_t::exec_signal. * thread.c (rb_thread_check_trap_pending): check rb_signal_buff_size() because rb_thread_t::exec_signal is no longer available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 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