summaryrefslogtreecommitdiff
path: root/thread.c
AgeCommit message (Collapse)Author
2007-11-13* blockinlining.c, compile.c, compile.h, debug.c, debug.h,ko1
id.c, insnhelper.h, insns.def, thread.c, thread_pthread.ci, thread_pthread.h, thread_win32.ci, thread_win32.h, vm.h, vm_dump.c, vm_evalbody.ci, vm_opts.h: fix comments and copyright year. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-12 * thread.c (call_trace_proc): should return value.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-11* insnhelper.ci (vm_call_method): pass mn->nd_clss toshugo
vm_call_cfunc() instead of klass. * vm.c (rb_thread_method_id_and_klass): traverse parent_iseq. * thread.c (call_trace_proc): use rb_thread_method_id_and_klass(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-10* thread.c (call_trace_proc): don't call ID2SYM() for ID_ALLOCATORshugo
to avoid SEGV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-06* eval_load.c (rb_feature_p): check if the feature is loading withnobu
load path. [ruby-dev:31932] * eval_load.c (load_lock): check the result of barrier waiting. * thread.c (rb_barrier_wait): check if owned by the current thread. * thread.c (rb_barrier_release): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-28* vm_core.h (rb_vm_struct): fix typo: bufferd -> buffered.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-27* thread.c: fix Mutex to be interruptable lock.ko1
* thread_win32.ci, thread_win32.h, thread_pthread.ci, thread_pthread.h: prepare native_cond_*() which are based on pthread_cond_*() spec. * prelude.rb: fix Mutex#synchronize method. * vm_core.h, include/ruby/intern.h: change unblock function interface (to pass some user data). * file.c, process.c: ditto. * benchmark/bm_vm2_mutex.rb: add a benchmark for mutex. * benchmark/bm_vm3_thread_mutex.rb: add a benchmark for mutex with contension. * benchmark/run.rb: fix to remove ENV['RUBYLIB'] for matzruby. * test/ruby/test_thread.rb: add a test. * common.mk: fix benchmark options. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-24* prelude.rb: added. run this script on startup.ko1
* tool/compile_prelude.rb: compile prelude.rb to C string. (prelude.rb -> prelude.c) * common.mk: fix to build with prelude.c. * inits.c (rb_call_inits): ditto. * thread.c (Init_Thread): move definition of Mutex#synchronize to prelude.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-20* vm_core.h (struct rb_thread_struct): removed first_func_arg andnobu
reuse first_args instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18* thread.c (is_ruby_native_thread): check properly. [ruby-dev:31166]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-17* thread.c (rb_thread_terminate_all): fix to ignoreko1
exceptions. * thread.c (thread_start_func_2): fix abort_on_exception process. [ruby-dev:31394] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-12* thread.c (rb_thread_raise): check if target thread isko1
thrown by another thread or not. [ruby-dev:31371] * bootstraptest/test_thread.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-10* thread.c (thread_start_func_2): not re-raise to main thread if it isnobu
joining the current thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-10* thread.c (thread_create_core): inherit the priority of creatingnobu
thread. submitted at [ruby-core:11873] by David Flanagan <david AT davidflanagan.com>. [ruby-core:11876] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-09* thread.c (thread_start_func_2): let abort_on_exception work.nobu
[ruby-core:11873] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-22* thread.c (is_ruby_native_thread): made an int function asnobu
well as version 1.8. * include/ruby/ruby.h (is_ruby_native_thread): moved prototype from intern.h as well as version 1.8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-20* compile.c, compile.h (DECL_ANCHOR, INIT_ANCHOR): split not tonobu
initialize aggregations with dynamic values. [ruby-talk:259306] * eval.c (rb_protect): not to initialize aggregations with dynamic values. [ruby-talk:259306] * gc.c (mark_current_machine_context): ditto. * thread.c (thgroup_list, call_trace_func): ditto. * vm.c (vm_init_redefined_flag): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-14* configure.in: add --enable-valgrind.akr
* gc.h (SET_MACHINE_STACK_END): new macro to replace rb_gc_set_stack_end. it find out accurate stack boundary by asm using gcc on x86. * thread.c (rb_gc_set_stack_end): don't define if asm-version SET_MACHINE_STACK_END is available. * gc.c (mark_current_thread): extracted from garbage_collect. it use SET_MACHINE_STACK_END to not scan out of stack area. it notify conservative GC information to valgrind if --enable-valgrind. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-12* blockinlining.c: remove "yarv" prefix.ko1
* array.c, numeric.c: ditto. * insnhelper.ci, insns.def, vm_evalbody.ci: ditto. * yarvcore.c: removed. * yarvcore.h: renamed to core.h. * cont.c, debug.c, error.c, process.c, signal.c : ditto. * ext/probeprofiler/probeprofiler.c: ditto. * id.c, id.h: added. * inits.c: ditto. * compile.c: rename internal functions. * compile.h: fix debug flag. * eval.c, object.c, vm.c: remove ruby_top_self. use rb_vm_top_self() instead. * eval_intern.h, eval_load: ditto. * gc.c: rename yarv_machine_stack_mark() to rb_gc_mark_machine_stack(). * insnhelper.h: remove unused macros. * iseq.c: add iseq_compile() to create iseq object from source string. * proc.c: rename a internal function. * template/insns.inc.tmpl: remove YARV prefix. * thread.c: * vm.c (rb_iseq_eval): added. * vm.c: move some functions from yarvcore.c. * vm_dump.c: fix to remove compiler warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-12* thread.c (thread_join): pthread_t may not be pointer.nobu
* thread_pthread.ci (ubf_select_each): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-12* thread_pthread.ci (thread_start_func_2): not use a directive insidenobu
a macro argument. [ruby-talk:258763] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-26* thread.c (rb_thread_wait_fd_rw): terminate fdset.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-24* call_cfunc.ci: removed.ko1
* insnhelper.ci: added. this function includes all functions that vm insns need. * common.mk: ditto. * insnhelper.h, vm.h, vm.c: move some declaration. * gc.h: remove GC_CHECK() macro because GC.stress is more useful. * compile.c, iseq.c, vm_dump: ditto. * gc.h, thread.c: move a prototype decalaration. * debug.c, debug.h: rename some functions. * compile.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-24* vm.c: some refactoring.ko1
* rename th_* to vm_*. * remove unused variables functions. * add prototypes. * blockinlining.c, compile.c, cont.c, eval.c, eval_intern.h, eval_jump.h, eval_load.c, inits.c, insns.def, iseq.c, parse.y, proc.c, process.c, signal.c, thread.c, vm.c, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-18* parse.y (yycompile): disable trace while creating ruby_debug_lines.nobu
[ruby-talk:253586] * thread.c (ruby_suppress_tracing): new function to call a function with suppressing trace. * lib/debug.rb, lib/tracer.rb: for YARV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-14* eval_load.c (Init_load): delay allocating an array for rb_load_pathakr
to avoid GC problem in very early stage. (RUBY_GC_STRESS causes GC in such stage.) * variable.c (rb_gc_mark_global_tbl): rb_global_tbl may be 0 in very early stage. * thread.c (thread_cleanup_func) [IA64]: clear register stack position. (thread_start_func_2) [IA64]: record the beginning of register stack using extra argument. (rb_gc_save_machine_context) [IA64]: record the end of register stack. * gc.c [IA64] (SET_STACK_END): record the end of register stack. (garbage_collect) [IA64]: use recorded register stack area for GC marking. (yarv_machine_stack_mark) [IA64]: GC mark from the register stack area. * yarvcore.c [IA64] (rb_gc_register_stack_start): defined. (Init_VM): store th->self on stack to fix GC problem. (Init_yarv) [IA64]: initialize the beginning of register stack. * yarvcore.h (struct rb_thread_struct) [IA64]: new members for register stack area. * thread_pthread.ci (thread_start_func_1) [IA64]: call thread_start_func_2 with the end of register stack. * cont.c (struct rb_context_struct) [IA64]: new members for register stack area. (cont_mark) [IA64]: GC mark from register stack area. (cont_free) [IA64]: free saved register stack. (cont_save_machine_stack) [IA64]: record the position and contents of the register stack. (cont_capture): store cont->self on stack to fix GC problem. (cont_restore_1) [IA64]: restore the register stack. [IA64] (register_stack_extend): new function. (cont_restore_0) [IA64]: call register_stack_extend instead of cont_restore_1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-07* thread.c (rb_thread_execute_interrupts): invoke ensure whenko1
main thread exits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05* compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,nobu
pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci, thread_pthread.ci, thread_win32.ci: fixed indentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-27* cont.c: support Fiber. Check test/ruby/test_fiber.rb for detail.ko1
Fiber is known as "Micro Thread", "Coroutine", and other terms. At this time, only Fiber#pass is supported to change context. I want to know more suitable method name/API for Fiber (... do you know more suitable class name instead of Fiber?) as "suspend/resume", "call", "yield", "start/kick/stop/restart", .... * eval.c, eval_intern.h, thread.c, yarvcore.c, yarvcore.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-23* cont.c: support callcc which everyone love.ko1
incomplete. please give me bug reports. * common.mk, inits.c, thread.c: ditto. * yarvcore.c: export thread_mark(). * yarvcore.h: disable value cache option. * eval_intern.h: set th_get_ruby_level_cfp to inline. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-10* thread.c (rb_thread_priority): rdoc fix; the initial value isnobu
inherited from the creating thread. [ruby-core:10607] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-03* configure.in, defines.h, eval_load.c (rb_feature_p, rb_provided,nobu
search_required, rb_require_safe), ext/extmk.rb: Fix a bug where a statically linked extension cannot be autoloaded. [ruby-dev:30023] / [ruby-dev:30239] * thread.c: added an internal class, Barrier. * yarvcore.h (struct rb_vm_struct): moved loading_table from global. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-03* thread.c: copied rdocs from fastthread.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-25* yarvcore.h: remove rb_control_frame_t#callee_id.ko1
* vm_macro.def: ditto. * eval_intern.h (exec_event_hooks): fix to check event flags * eval_intern.h (EXEC_EVENT_HOOK): fix to re-check event flags. * ext/probeprofiler : added. this profiler is sampling based profiler. * vm.c: add rb_thread_current_status() API for probeprofiler. * thread.c (rb_thread_execute_interrupts): add comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-25* eval_intern.h (PUSH_TAG): no argument now.nobu
* eval.c, eval_error.h, eval_jump.h, eval_load.c, proc.c, thread.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-25* thread.c (alloc_event_fook, rb_thread_remove_event_hook): shouldnobu
return value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-19* eval.c (ruby_cleanup): re-send signal. [ruby-dev:30516]nobu
* eval_error.h (error_handle): no message when exiting by signal. * intern.h (rb_thread_signal_raise, ruby_default_signal): prototypes. * signal.c (esignal_init): takes a signal number and an optional signal name. * signal.c (interrupt_init): pass SIGINT always. * signal.c (ruby_default_signal): invoke system default signal handler. * signal.c (rb_f_kill): use NUM2PIDT instead of NUM2INT. * signal.c (rb_signal_exec, trap): handle SIGTERM. [ruby-dev:30505] * thread.c (rb_thread_signal_raise): now takes signal number instead of signal name. * thread.c (rb_thread_signal_exit): since rb_make_exception() calls #exception method, rb_class_new_instance() is not needed here. * yarvcore.h (struct rb_vm_struct), eval_jump.h (terminate_process): exit_code is no longer stored in VM. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-19* eval.c, node.h, thread.c, yarvcore.[ch], eval_intern.h:ko1
support set_trace_func (incomplete. id and klass don't be passed). And support Thread#set_trace_func which hook only specified thread and Thread#add_trace_func which add new trace func instead of replace old one. C level API was modified. See thread.c (logic) and yarvcore.h (data structures). * vm.c, vm_macro.def: add hook points. * compile.c, insns.def: fix "trace" instruction. * iseq.c, vm_macro.h: add compile option "trace_instruction". * test/ruby/test_settracefunc.rb: hook "c-return" of set_trace_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-12* thread.c (mutex_try_lock): check and set owner thread.ko1
* thread_pthread.ci: fix to show error code in error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-09 * thread.c (do_select): ubf_select() is not necessary. interrupt isusa
checked in the loop. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-09* thread.c (do_select): sorry, typo.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-09 * thread.c (do_select): use ubf_select() as UBF on windows.usa
* win32/win32.c (do_select): shouldn't call catch_interrupt() here. fixed: [ruby-dev:30674], reported by wanabe. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-02* insns.def (throw), thread.c, yarvcore.h (throwed_errinfo): fixednobu
typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-19* thread.c (thread_start_func_2): store the result of first_funcnobu
as well as first_proc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-19* thread.c (thread_create_core): block is not used if first_funcnobu
is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-19* regparse.c, etc.: K&R to ANSI code cleanup patch from Stefanmatz
Huehner <stefan at huehner.org>. [ruby-core:10543] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-08* compile.c: iseq_compile -> rb_iseq_compile.aamine
* iseq.c: ditto. * intern.h: provide function prototype of Init_jump. * eval_jump.h (Init_jump): declare function type. * thread.c: platform-dependent functions should be surrounded by #ifdef. * iseq.c (iseq_data_to_ary): remove unused variable. * compile.c (set_arguments): ditto. * thread.c (set_unblock_function): ditto. * thread_pthread.ci: reduce printf warning. * vm_dump.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-25* thread.c (rb_thread_run): fix to ANSI style.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24* thread.c (DEBUG_OUT): leave pointer size to runtime.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24* intern.h (rb_thread_blocking_region): add prototype.nobu
* thread.c (BLOCKING_REGION): restore previous UBF. * thread.c (rb_thread_blocking_region): default UBF to interrupt in system dependent way by RB_UBF_DFL. + ubf_select() on posix system + ubf_handle() on Win32 + none on cygwin git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e