must be called even when pthread_getattr_np is used.
[ruby-core:31269]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
native_thread_init_stack(th) on cygwin to avoid the segv
introduced by r27789. Cygwin's signal implementation is half
baked so USE_SIGNALSTACK is not defined and it needs another
treatment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Satoshi Shiba <shiba AT rvm.jp> at [ruby-dev:40973].
* gc.h (ruby_get_stack_grow_direction): fixed prototype.
* thread_pthread.c (get_stack, ruby_stack_overflowed_p): both side
should be same type. [Bug #3145]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
patched by KOSAKI Motohiro [ruby-dev:40309]
* thread_pthread.c (ruby_init_stack): use get_stack
on platforms which have pthread_attr_get_np.
(FreeBSD, DragonFlyBSD and NetBSD)
This is because FreeBSD and DragonFly BSD must use
pthread_attr_get_np to get stack size of main thread,
but Mac OS X and Linux with LinuxThreads must use getrlimit.
<http://www.nminoru.jp/~nminoru/programming/stackoverflow_handling.html>
<http://d.hatena.ne.jp/nurse/20100204>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to get the stack size of the main thread on FreeBSD.
* thread_pthread.c: include pthread_np.h on FreeBSD.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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
* template/known_errors.inc.tmpl: generate defined_error() and
undefined_error() instead of set_syserr.
* error.c (Init_syserr): define defined_error() and undefined_error()
to follow the above change.
(rb_strerrno): defined.
* thread_pthread.c: show error message and errno macro name with
rb_bug.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
platforms where PTHREAD_STACK_MIN is not compile time constant.
[ruby-dev:39751]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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@25843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
message to stderr instead of using rb_bug().
* KNOWNBUGS.rb, bootstraptest/test_fork.rb: move a fixed test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
is in the buffer or not.
* thread_pthread.c (thread_timer): don't exit the loop when signal
is in the buffer. [ruby-dev:37637]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21265 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
some platform. a patch from zunda <zunda616e AT yahoo.co.jp> in
[ruby-dev:32904].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
thread_win32.c: make some functions static functions.
a patch from Tadashi Saito <shiba AT mail2.accsnet.ne.jp>
in [ruby-core:14407]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
RUBY_VM_SET_TIMER_INTERRUPT(), RUBY_VM_INTERRUPTED().
* thread.c, thread_pthread.c, thread_win32.c: fix to ignore time slice
event until sleep.
* bootstraptest/test_thread.rb: add a test for time limited join test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e