staff.
* signal.c (signal_buff): per process resouce now.
* signal.c (trap_list): moved to VM.
* signal.c (rb_get_next_signal): reverted.
* signal.c (rb_trap_exit): trap_pending_list was no longer used.
* thread.c (timer_thread_function): delivers buffered per-process
signals to each VMs.
* vm.c (rb_vm_mark): marks trap_list.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
RUBY_UBF_IO and RUBY_UBF_PROCESS.
Because there is no default (universal) unblocking function.
* ext/socket/socket.c, file.c, io.c, process.c, thread.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
this function may cause ruby's thread switching.
* include/ruby/intern.h: ditto.
* regint.h: use rb_thread_check_ints() instead of
RUBY_CHECK_INTS() directly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
using time slice. if you enable USE_NATIVE_THREAD_PRIORITY
macro, this mechanism is ignored. [ruby-dev:33124]
* thread_pthread.c, thread_win32.c: ditto.
* test/ruby/test_thread.rb: fix test parameter.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
r18239 because r18245 made the changes unnecessary.
* thread.c (rb_mutex_struct): define after including thread_{pthread,
win32}.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
*_free against an object that is going to be free'ed. So, change type
of thread_t#keeping_mutexes from VALUE to mutex_t.
* vm.c: remove mark to keeping_mutexes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* gc.c: fix deferred finalizer system. finalize processes of
T_DATA and T_FILE are executed after gc process.
And fix to use BUILTIN_TYPE() instead of seeing flag.
* thread.c, vm_core.h: add RUBY_VM_SET_FINALIZER_INTERRUPT()
and check intterupt_flag at rb_thread_execute_interrupts().
* thread.c (mutex_mark): fix to mark next_mutex.
* vm.c (rb_thread_mark): fix to mark keeping_mutexes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c (thread_debug): show source name and line if possible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
klass during measurement.
* parse.y (coverage, yycompile0): ditto.
* iseq.c (prepare_iseq_build): use rb_hash_lookup instead of
rb_hash_aref.
* thread.c (rb_coverage_result): restore klass of coverage array and
return it.
* theaad.c (update_coverage): chcek whether its klass is 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
COVERAGE__ and introduce coverage.so instead. How to measure
coverage: (1) require "coverage.so", (2) require or load Ruby source
file, and (3) Coverage.result will return the same hash as COVERAGE__.
[ruby-dev:35324]
* thread.c (rb_enable_coverages): start coverage measurement by using
rb_add_event_hook.
* thread.c (rb_get_coverages): returns current results of coverage
measurement.
* include/ruby/intern.h: add prototype for above two functions.
* vm_core.h, vm.c: add field of coverages to rb_vm_t.
* insns.def (trace): remove special handling for COVERAGE__.
* iseq.c (prepare_iseq_build): switch COVERAGE__ to
rb_get_coverages().
* parse.y (coverage): ditto.
* thread.c (clear_coverage): ditto.
* lib/coverage.rb: use coverage.so instead of COVERAGE__.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
for casual use. Usage: (1) assign {} to COVERAGE__, (2) require or
load Ruby source file, and (3) COVERAGE__["sourcefilepath"] will
return an array whose elements represent number of executions per
line of source code.
* vm_core.h: add field of coverage array to iseq.
* iseq.c (prepare_iseq_build): ditto.
* insns.def (trace): update coverage array.
* parse.y (coverage): create and initialize coverage array.
* compile.h (ADD_TRACE): add trace instruction to update covearge
array.
* thread.c (clear_coverage): delete coverage array when forking.
Otherwise, double count of coverage may occur.
* lib/coverage.rb: sample coverage measurement tool.
* error.c: distinguish explicitly between parse_in_eval and
mild_compile_error.
* load.c: ditto.
* vm_eval.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_insnhelper.c (vm_yield_with_cfunc): vm_yield_with_cfunc receives
blockptr and passes it to iterating block.
* proc.c (rb_proc_call), include/ruby/intern.h: rb_proc_call receives
blockptr. "rb_proc_call(self, args, blockptr)" in C corresponds to
"self.call(*args, &block)" in Ruby.
* proc.c (proc_call): pass blockptr to block that is written in C.
* proc.c (curry): receive blockptr and pass it to original proc.
[ruby-core:15551]
* vm.c (invoke_block_from_c): fix for change of vm_yield_with_cfunc.
* thread.c (call_trace_proc), eval_jump.c (rb_call_end_proc): fix for
change of rb_proc_call.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e