aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
Commit message (Collapse)AuthorAgeFilesLines
* * thread.c (do_select): wrong conditions. [ruby-core:27753]usa2010-01-251-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thread_start_func_2): unlock all locking mutexesnobu2010-01-231-7/+26
| | | | | | | | | | | | | | before clean up. [ruby-core:26877] * thread.c (rb_thread_atfork): no other threads to be joined. * vm_core.h (rb_thread_lock_unlock, rb_thread_lock_destroy): new functions. * vm.c (ruby_vm_destruct): unlock and destroy global VM lock. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* removes the dtrace support. reverts r26239, r26238 and r26235.yugui2010-01-051-12/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c: added UNLIKELY to probes for optimization.yugui2010-01-041-7/+7
| | | | | | | | * vm.c: ditto. * thread.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * trace.h: new file. wraps tracing mechanisms.yugui2010-01-031-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * defs/dtrace.d: new file. defined a dtrace provider "ruby". * include/ruby/ruby.h (LIKELY): moved from vm.c. (UNLIKELY): ditto. (OBJSETUP): probe "object-create". (RUBY_EVENT_RESCUE): new event. * vm_exec.c (DEBUG_ENTER_INSN): embeded a probe insn-entry into it. (DEBUG_END_INSN): insn-return. * vm.c (LIKELY): moved into ruby.h. (UNLIKELY): ditto. (Init_BareVM): embeded a probe "raise" into it. * variable.c (rb_class2name_without_alloc): new utility function. * tool/rbinstall.rb (install?(:ext, :arch, :'ext-arch')): installs dtrace.d if necessary. * thread_pthread.c (add_signal_thread_list): probe "raise". (rb_thread_create_timer_thread): ditto. * thread.c (rb_thread_schedule_rec): probes "thread-enter" and "thread-leave", (thread_start_func_2): ditto. (thread_cleanup_func): probe "thread-term" * lib/mkmf.rb: supports dtrace postprocessor on making an extension. * iseq.c (rb_vm_insn_name): new utility function. (rb_vm_insn_len): ditto. * insns.def (hook): probes "method-etnry", "method-return", "line", and "rescue". * compile.c (iseq_compile_each): adds a trace op for "rescue" probe. * gc.c (garbage_collect): probes "gc-begin" and "gc-end". (obj_free): probe "object-free" (garbage_collect_with_gvl): probe "raise" (negative_size_allocation_error): ditto. (rb_memerror): ditto. * eval.c (rb_rescue2): probe "rescue" (rb_longjmp): probe "raise" * ext/probe/probe.c: new extension for application defined probes. * ext/probe/extconf.rb: ditto. * configure.in (--with-tracing-model): new option to choose a tracing mechanism. (DTRACE): new substitution. name of dtrace(1). (RUBY_TRACING_MODEL): new substitution. (DTRACE_OBJ): ditto. (MINIDTRACE_OBJ): ditto. (GOLFDTRACE_OBJ): ditto. (LIBRUBY_DTRACE_OBJ): ditto. (RUBY_DTRACE_POSTPROCESS): new macro. checks whether the dtrace on the system needs postprocessing. (RUBY_DTRACE_BSD_BROKEN): new macro. checks whether the dtrace supports USDT. * Makefile.in: (DTRACE): new variable. name of dtrace(1). (TRACING_MODEL): new variable. name of the chosen tracing mechanism. (DTRACE_OBJ): same as the one in configure.in. (MINIDTRACE_OBJ): ditto. (GOLFDTRACE_OBJ): ditto. (LIBRUBY_DTRACE_OBJ): ditto. (CPPOUTFILE): new substitution. necessary for generating dtrace.d (trace_none.h): new target for TRACING_MODEL=none (RUBY_H_INCLUDES): appended a header for tracing. (distclean-local): also removes preprocessed version of dtrace.d ($(LIBRUBY_A)): needs $(LIBRUBY_DTRACE_OBJ) if dtrace needs postprocessing. ($(PROGRAM)): ditto. (golf): ditto. (miniruby): ditto. ($(arch_hdrdir)/ruby/dtrace.d): new target. preprocessed verson of defs/dtrace.d. generated if necessary. ($(arch_hdrdir)/ruby/trace_dtrace.h): new target. definition of probes. ($(LIBRUBY_DTRACE_OBJ)): new target. generated if dtrace needs postprocessing. ($(DTRACE_OBJ)): ditto. ($(MINIDTRACE_OBJ)): ditto. ($(GOLFDTRACE_OBJ)): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* doc fix: mutex.lock => self [ruby-core:27115]naruse2009-12-131-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_atfork_internal): reinitialize global locknobu2009-11-181-0/+1
| | | | | | | | at fork to get rid of deadlock. based on the patch from Hongli Lai in [ruby-core:26783]. [ruby-core:26361] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (terminate_atfork_i): all mutex locks by other threadsnobu2009-11-181-0/+18
| | | | | | | have been abandoned at fork. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thread_cleanup_func): delete locking_mutex when threadmame2009-11-151-0/+1
| | | | | | | | | object become dummy because of fork. [ruby-core:26744] [ruby-core:26745] * bootstraptest/test_thread.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thread_start_func_2): see first_func, not first_proc,nobu2009-11-131-2/+2
| | | | | | | to decide which to use. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thread_create_core): moved failure handling fromnobu2009-11-121-1/+7
| | | | | | | native_thread_core(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (blocking_region_begin): define before BLOCKING_REGION.akr2009-11-101-10/+11
| | | | | | | reported by Luis Lavena. [ruby-core:26670] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_gc_save_machine_context): don't save the stack pointerakr2009-11-091-17/+18
| | | | | | | | | | | | | | in this function. (RB_GC_SAVE_MACHINE_CONTEXT): call rb_gc_save_machine_context and save the stack pointer at caller side. (rb_thread_schedule_rec): use RB_GC_SAVE_MACHINE_CONTEXT instead of rb_gc_save_machine_context. (blocking_region_begin): changed to a macro. use RB_GC_SAVE_MACHINE_CONTEXT instead of rb_gc_save_machine_context. [ruby-dev:39659] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos.akr2009-11-031-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread_{pthread,win32}.c (native_stop_timer_thread): join the threadusa2009-11-021-3/+2
| | | | | | | | | | | | | here. * thread_{pthread,win32}.c (native_reset_timer_thread): new function. * thread.c (rb_thread_stop_timer_thread, rb_thread_reset_timer_thread): call above function instead of simply seting 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_blocking_region): reverted r25566, and addednobu2009-10-301-34/+5
| | | | | | | | description that no exception is allowed inside `func', instead. see [ruby-dev:39582] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_blocking_region): standard C doesn't acceptusa2009-10-301-2/+4
| | | | | | | | preprosessing directive within macro expansion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_blocking_region): must ensure to unlock GVL.nobu2009-10-301-1/+29
| | | | | | | [ruby-dev:39579] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: Revert changes to Thread#raise made in r25278 [ruby-core:25367]marcandre2009-10-121-11/+1
| | | | | | * eval_intern.h: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: Doc fix for Thread#raisemarcandre2009-10-111-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_threadptr_errinfo): renamed.nobu2009-10-101-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_threadptr_execute_interrupts_rec, rb_threadptr_raise): ↵marcandre2009-10-101-1/+11
| | | | | | | | Thread#raise with no argument will now re-raise the current exception if there is one [ruby-core:25367] * eval.c (get_errinfo, rb_rubylevel_thread_errinfo): Getter for current exception for a given thread git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (ruby_suppress_tracing): get rid of clobbering bynobu2009-10-021-1/+2
| | | | | | | longjmp. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,nobu2009-09-211-6/+6
| | | | | | | | | thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c, vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl, tool/instruction.rb: fixed types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: added rdocs.nobu2009-09-171-0/+50
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_s_debug_set): set level, not only boolean.nobu2009-09-171-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_exec_recursive_outer, rb_exec_recursive): Added method to ↵marcandre2009-09-151-18/+73
| | | | | | | | | | | | | | | | | | short-circuit to the outermost level in case of recursion * test/ruby/test_thread.rb (test_recursive_outer): Test for above * hash.c (rb_hash_hash): Return a sensible hash for in case of recursion [ruby-core:24648] * range.c (rb_range_hash): ditto * struct.c (rb_struct_hash): ditto * array.c (rb_array_hash): ditto * test/ruby/test_array.rb (test_hash2): test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thread_list_access): prototyped.nobu2009-09-131-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (recursive_*): refactored the access to the inspect table used bymarcandre2009-09-131-59/+83
| | | | | | | rb_exec_recursive_*. The functions recursive_push, pop and check now assume a valid hash table as their first argument. Added documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thgroup_data_type, mutex_data_type, barrier_data_type):nobu2009-09-091-12/+48
| | | | | | | typed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h (st_hash_func): use st_index_t.nobu2009-09-081-3/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert wrong commit r24715 "* thread.c (do_select): suppress warnings."naruse2009-08-301-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (do_select): suppress warnings.naruse2009-08-301-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (do_select): rollback r24680. void struct initializer isusa2009-08-281-1/+1
| | | | | | | | invalid. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (do_select): suppress warnings.nobu2009-08-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_schedule): don't recur infinitely.akr2009-08-221-7/+23
| | | | | | | | (rb_threadptr_execute_interrupts): ditto. [ruby-dev:38060] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_check_deadlock): decrease number of sleepers beforemame2009-08-211-0/+1
| | | | | | | deadlock detection because the deadlock exception makes main thread run. [ruby-dev:39142] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_terminate_all): do not ignore interrupt whenmatz2009-08-201-4/+8
| | | | | | reaping threads on termination. [ruby-dev:39107] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (recursive_push): need to set UNTRUST. [ruby-dev:38997]matz2009-08-031-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (recursive_push): untrust internal hash to preventmatz2009-08-031-0/+2
| | | | | | | unexpected SecurityError. a patch from Kazuhiro NISHIYAMA. Fix: #1864 [ruby-dev:38982] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_threadptr_exec_event_hooks): new function tonobu2009-07-051-0/+26
| | | | | | | execute event hooks, with preserving errinfo. [ruby-core:24118] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (ruby_thread_stack_overflow): call rb_exc_raise() onmatz2009-06-171-1/+10
| | | | | | | | | stack overflows in the signal handler, if sigaltstack is available. On stack overflow (and with sigaltstack), the signal handler is more likely to have room to create an exception object. [ruby-core:23813] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c, vm_eval.c: add Thread.backtrace.ko12009-06-141-0/+9
| | | | | | | | * test/ruby/test_thread.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: rename functions which require a parameterko12009-06-081-38/+57
| | | | | | | | | | | | | | | "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
* * thread.c (rb_exec_recursive_paired): new function for propernobu2009-05-241-18/+69
| | | | | | | | | | | handling of recursive arrays. [EXPERIMENTAL] [ruby-core:23402] * array.c (rb_ary_equal, rb_ary_eql, rb_ary_cmp): use above. * hash.c (hash_equal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: fixed types.nobu2009-05-091-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_fd_select): new function to call selectmatz2009-04-011-0/+31
| | | | | | | | | | using rb_fdset_t. * io.c (select_internal): use rb_thread_fd_select instead of rb_thread_select. based on the patch from Kengo Matsuyama. [ruby-dev:38221] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, bignum.c, dln.c, error.c, gc.c, io.c, marshal.c,nobu2009-03-121-1/+1
| | | | | | | | | | numeric.c, pack.c, strftime.c, string.c, thread.c, transcode.c, transcode_data.h, util.c, variable.c, vm_dump.c, include/ruby/encoding.h, missing/crypt.c, missing/vsnprintf.c: suppress VC type warnings. [ruby-core:22726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_error.c (error_print): use volatile to suppress warnings.akr2009-02-281-1/+1
| | | | | | | | | | | | | | | * vm_eval.c (eval_string_with_cref): ditto. * thread.c (rb_exec_recursive): ditto. * eval_jump.c (rb_exec_end_proc): ditto. * eval.c (ruby_exec_node): ditto. (rb_longjmp): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thread_cleanup_func): unlock all locked mutexes even whenmame2009-02-231-11/+11
| | | | | | | forking. [ruby-core:22269] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e