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
- -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
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
[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
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
* 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
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
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
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
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
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
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
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
"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