summaryrefslogtreecommitdiff
path: root/thread.c
AgeCommit message (Collapse)Author
2011-02-14 * thread.c (rb_thread_io_blocking_region): reset th->waiting_fdnagachika
after blocking region, because remaining waiting_fd might cause unnecessary IOError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-12* thread.c (rb_thread_io_blocking_region): new function to runnobu
blocking region with GIL released, for fd. * thread.c (rb_thread_fd_close): implement. [ruby-core:35203] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-31 * thread.c (thread_start_func_2): check deadlock condition beforenagachika
release thread stack. fix memory violation when deadlock detected. reported by Max Aller. [Bug #4009] [ruby-core:32982] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-08* thread.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 * thread.c (rb_thread_atfork): Add small comment why we needkosaki
reset random seed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-20 * thread.c (thread_cleanup_func): Moved interrupted_lockkosaki
destroying code from native_thread_destroy() to thread_cleanup_func() because it's platform independent logic. * thread_win32.c (native_thread_destroy): ditto. * thread_pthread.c (native_thread_destroy): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-20 * thread.c (thread_cleanup_func): Don't touch native threadingkosaki
resource at fork. Sadly this is purely bandaid. We need to implement proper fix later. [Bug #4169] [ruby-core:33767] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-27* thread.c, vm_core.h: make gvl_acquire/release/init/destructko1
APIs to modularize GVL implementation. * thread_pthread.c, thread_pthread.h: Two GVL implementations. (1) Simple locking GVL which is same as existing GVL. (2) Wake-up queued threads. The wake-up order is simple FIFO. (We can make several queues to support exact priorities, however this causes some issues such as priority inversion and so on.) This impl. prevents spin-loop (*1) caused on SMP environemnts. *1: Only one Ruby thread acqures GVL again and again. Bug #2359 [ruby-core:26694] * thread_win32.c, thread_win32.h: Using simple lock not by CRITICAL_SECTION but by Mutex. Bug #3890 [ruby-dev:42315] * vm.c (ruby_vm_destruct): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* configure.in (RUBY_CHECK_PRINTF_PREFIX): check for printf formatnobu
specifier if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* compile.c (iseq_build_body), error.c (set_syserr, get_syserr),nobu
(syserr_initialize), gc.c (define_final, rb_gc_copy_finalizer), (run_final), hash.c (rb_hash_aref, rb_hash_lookup2), (rb_hash_fetch_m, rb_hash_clear, rb_hash_aset, eql_i), iseq.c (iseq_load, iseq_data_to_ary), marshal.c (r_symlink), thread.c (rb_thread_local_aref), variable.c (generic_ivar_remove, ivar_get, rb_const_get_0), (rb_cvar_get), vm.c (rb_vm_check_redefinition_opt_method), vm_insnhelper.c (vm_get_ev_const), vm_method.c (remove_method), ext/iconv/iconv.c (map_charset): use st_data_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-09* vm_core.h (rb_signal_buff_size, rb_signal_exec): movednobu
declarations from thread.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-09* thread.c (thread_reset_event_flags, exec_event_hooks): ignorenobu
hooks marked as removed. * thread.c (thread_exec_event_hooks): remove hooks to be removed. * thread.c (rb_threadptr_remove_event_hook, rb_remove_event_hook): defer removing hooks if running the hooks. [ruby-dev:42350] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-09* thread.c (rb_threadptr_exec_event_hooks): suppress each eventnobu
hooks separately. * thread.c (thread_suppress_tracing): split from ruby_suppress_tracing, accepting thread pointer and event mask. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-08* thread.c (rb_threadptr_remove_event_hook): fix typo.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-03* enc/unicode.c (onigenc_unicode_property_name_to_ctype):naruse
remove useless assignment. * vm.c (vm_make_proc_from_block): ditto. * variable.c (rb_ivar_count): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-01* thread.c (ruby_suppress_tracing): restore the state and invokenobu
the func with normal state. a patch from Satoshi Shiba <shiba AT rvm.jp> at [ruby-dev:42162]. [ruby-core:31783] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-14* thread.c (rb_gc_mark_threads): deprecated.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-18* include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu
add parent member. * error.c (rb_typeddata_inherited_p): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-17* thread.c (rb_thread_wakeup_alive): split from rb_thread_wakeup.nobu
merged from r13476. c.f. [ruby-core:31320] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-28* thread.c (rb_fd_resize, rb_fd_copy): avoid NULL dereference uponmame
failed realloc by using xrealloc instead of not realloc. a patch from Jim Meyering <meyering at redhat.com> in [ruby-core:30920] [Bug #3489] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-07* thread.c (Init_Thread): no need to suppress warning fornobu
ruby_thread_set_native anymore. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-05* vm.c (Init_BareVM): call Init_native_thread here.akr
* thread.c (Init_Thread): don't call Init_native_thread. * thread_pthread.c (Init_native_thread): exported. * thread_win32.c (Init_native_thread): ditto. [ruby-dev:41536] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29* removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29* thread.c (RB_GC_SAVE_MACHINE_CONTEXT), gc.c (ruby_gc_stress_start):tarui
revert r28078. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29* thread.c (RB_GC_SAVE_MACHINE_CONTEXT): start GC tarui
by switching the thread if gc_stress == true * gc.c (ruby_gc_stress_start): dotto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-28 * thread.c (blocking_region_begin): avoid RUBY_VM_CHECK_INTS()kosaki
call during GVL state transition. [Bug#3354] [ruby-dev:41435] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-20* thread.c (subtract_tv): if the rest is zero, should finish waitingusa
immediately. * win32/win32.c (subtract): ditto. based on a patch from Roger Pack in [ruby-core:27957]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17* array.c: Documentation: change => in call-seq to ->.marcandre
Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-13* vm_core.c (rb_thread_struct): add a field for sigaltstack.mame
* thread_pthread.c (thread_start_func_1): initialize machine stack information. * thread.c (thread_start_func_2): set sigaltstack for each sub thread. [ruby-core:24540] [ruby-core:30207] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-08* thread.c (rb_thread_aset): fixed argument type.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-08* error.c: RDoc for subclasses of Exception. [ruby-core:28394]marcandre
* cont.c: ditto * enumerator.c: ditto * io.c: ditto * math.c: ditto * numeric.c: ditto * proc.c: ditto * re.c: ditto * thread.c: ditto * transcode.c: ditto. Thanks to Run Paint for some of the documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-28* thread. (rb_thread_terminate_all): revert r24591 which caused SEGVmame
sometimes. [ruby-dev:40936] [ruby-core:27245] [ruby-core:27416] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-28* thread.c (timer_thread_function): unused variable.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-27* eval.c (ruby_cleanup): before cleanup, check signal buffer and runmame
handler if any. [ruby-core:20970] * thread.c (rb_threadptr_check_signal): separeted from timer_thread_function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-19* thread.c (rb_thread_blocking_region, rb_thread_blocking_region_end):mame
preserve errno. [Bug #2606] [ruby-core:28924] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-15* thread.c (rb_thread_priority, rb_thread_priority_set): fix rdoc.mame
Lower-priority thread may run even if there are higher-priority threads. See [ruby-dev:40977]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-06 * vm_core.h: Introduce UNINITIALIZED_VAR() macro.kosaki
* thread.c (do_select): Use UNINITIALIZED_VAR() instead FAKE_FD_ZERO(). Also, remove FAKE_FD_ZERO completely. [Feature #3018] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-25* thread.c (thread_reset_event_flags): set flags to thread.wanabe
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-24* thread.c (thread_create_core): let new thread inherit RUBY_EVENT_VMmame
of event_flags. [ruby-core:25191] * thread.c (rb_threadptr_exec_event_hooks): delete RUBY_EVENT_VM if all event_hooks are removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-25* thread.c (do_select): wrong conditions. [ruby-core:27753]usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-23* thread.c (thread_start_func_2): unlock all locking mutexesnobu
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
2010-01-05removes the dtrace support. reverts r26239, r26238 and r26235.yugui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-04* gc.c: added UNLIKELY to probes for optimization.yugui
* vm.c: ditto. * thread.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-03* trace.h: new file. wraps tracing mechanisms.yugui
* 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
2009-12-13doc fix: mutex.lock => self [ruby-core:27115]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-18* thread.c (rb_thread_atfork_internal): reinitialize global locknobu
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
2009-11-18* thread.c (terminate_atfork_i): all mutex locks by other threadsnobu
have been abandoned at fork. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-15* thread.c (thread_cleanup_func): delete locking_mutex when threadmame
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
2009-11-13* thread.c (thread_start_func_2): see first_func, not first_proc,nobu
to decide which to use. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-12* thread.c (thread_create_core): moved failure handling fromnobu
native_thread_core(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e