* array.c: fixes for the updated documentation in r35858:
  Typos and #take/#drop accept to take/drop 0 elements.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
array.c: refactoring of rb_ary_delete_same()

* array.c (ary_resize_smaller): new function to resize array.

* array.c (rb_ary_delete): refactoring to extract a function.

* array.c (rb_ary_delete_same): refactoring.
  It renames function, reduces duplicated code and removes unused
  code.

* gc.c (wmap_final_func): follow the above change.

* internal.h (rb_ary_delete_same): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_process.rb (test_setsid): call Process.getsid for
  child process in child process. because parent process call
  Process.getsid with io.pid, Errno::ESRCH could be raised.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 2012-11-26

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_process.rb (test_setsid): added a few wait for
  preventing that Process.getsid(io.pid) makes Errno::ESRCH.
  (refix r37844)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Makefile.sub: fix r37821

* win32/Makefile.sub (DLNOBJ): missing in r37821.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
string.c: suppress warnings

* string.c (rb_str_enumerate_{lines,chars,codepoints}): suppress
  uninitialized variable warnings.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* bignum.c (big_div_struct): added volatile to 'stop' member.
  Otherwise, "if (bds->stop)" check in bigdivrem1 don't read
  memory and ignore interrupt.
* bignum.c (bigdivrem, rb_big_stop): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* bignum.c (bigdivrem): restart calculation when bigdivrem1 was
  interrupted by signal. Otherwise, ruby script may see a garbage
  value.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (argf_each_codepoint): add missing ARGF#codepoints [Bug #7438]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_core.h (rb_thread_struct): added 'in_trap' member for marking
  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
* string.c (rb_str_enumerate_chars, rb_str_enumerate_codepoints)
(rb_str_enumerate_lines): suppress "may be used uninitialized in
  this function" warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* benchmark/driver.rb: accept multiple `-e'.
  You don't need to use `;' separation character.
  [ruby-core:50139] [ruby-trunk - Bug #7380]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
split trap interrupt and async interrupt

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* signal.c (signal_exec): suppress "warning: variable 'signum'
  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
* signal.c (signal_exec): add volatile to make sure setjmp safe.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* common.mk: specify label `built-ruby'.
* benchmark/driver.rb: quote path.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* bootstraptest/test_thread.rb: try to `join' each 100
  threads.
  This benchmark seems consuming long time on travis-ci
  several times (and make `failure').



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* iseq.c (make_compile_option_value): add trace_instruction option.
  a patch by davidbalbert (David Albert).
  [Bug #6786]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby_atomic.h (ATOMIC_CAS): new macro for compare-and-exchange.

* 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