matz
98ad274974
* thread.c (rb_thread_key_p): should always convert symbol to ID.
...
[ruby-dev:34588]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-07 13:24:03 +00:00
nobu
87e4ad0a23
* io.c, signal.c, thread.c, thread_win32.c, include/ruby/intern.h:
...
suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-26 09:36:35 +00:00
matz
707c50d341
* thread.c (rb_thread_stop_timer_thread): should clear
...
timer_thread_id after stopping it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-22 04:26:44 +00:00
nobu
9c77076296
* thread.c (thread_join): remove the current thread from the join list
...
of the target thread.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-22 04:13:01 +00:00
nobu
31a060f7bd
* thread_pthread.c (lock_func): should not check interrupts in
...
blocking region. [ruby-dev:34378]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-13 09:52:29 +00:00
nobu
69352c0d4d
* thread.c (lock_func): optimized and checks for interrupt_flag.
...
based on a patch from Sylvain Joyeux in [ruby-Patches-19361] and
[ruby-Patches-19362].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-09 05:43:29 +00:00
nobu
d7b8efd872
* thread.c (rb_mutex_sleep): ensures to re-acquire at waking up.
...
[ruby-Patches-19361]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-08 12:36:42 +00:00
akr
0ef84dcefc
* io.c: IO.copy_stream implemented. [ruby-dev:33843]
...
* thread.c (rb_fd_select): new function.
* configure.in (sys/sendfile.h): check the header file.
(sendfile): check the function.
(pread): check the function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-30 06:38:05 +00:00
matz
207b8292ba
* eval_method.c (rb_get_method_body): ent->method may be freed by
...
GC. [ruby-dev:31819]
* thread.c (remove_event_hook): should not access freed memory.
[ruby-dev:31820]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-01 03:36:33 +00:00
nobu
ecd35c0d96
* eval.c (stack_check): made flag per threads.
...
* thread.c (rb_thread_set_raised, rb_thread_reset_raised): prefixed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-28 04:52:01 +00:00
matz
4920980d17
* thread.c (thread_create_core): prohibit thread creation in the
...
frozen thread group. a patch in [ruby-dev:33176] from sheepman
<sheepman AT sheepman.sakura.ne.jp>.
* thread.c (thread_create_core): should inherit ThreadGroup from
the current thread.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-18 18:48:12 +00:00
nobu
3882b07c3a
* thread.c (thread_create_core): set thread group before creating
...
thread.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-18 14:49:43 +00:00
nobu
3a4bfbad09
* thread.c (thread_cleanup_func): ignore errors from destroying mutex
...
of dead thread. [ruby-core:15069]
* thread_pthread.c, thread_win32.c (native_thread_destroy): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-18 06:57:08 +00:00
ko1
5360e77db8
* thread.c: clear thread structure.
...
(TODO: survey that child process should clear mutex or not).
* bootstraptest/test_knownbug.rb, test_thread.rb: move a fixed test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-14 10:02:51 +00:00
matz
d17bcfc802
* thread.c (rb_mutex_unlock): proper error message for unlocking
...
mutex that is not locked. a patch from Yusuke ENDOH
<mame at tsg.ne.jp> in [ruby-dev:33010].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-10 16:12:32 +00:00
akr
6cdef2dc7e
* $Date$ keyword removed to avoid inclusion of locale dependent
...
string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06 15:49:38 +00:00
ko1
e037d72514
* thread.c: remove Thread.critical(=).
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25 13:14:23 +00:00
ko1
b79c868296
* include/ruby/ruby.h, thread.c: rename is_ruby_native_thread() to
...
ruby_native_thread_p().
* ext/tk/tcltklib.c: apply it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25 07:28:51 +00:00
ko1
884f1eed2c
* thread.c (rb_thread_wait_fd_rw): should check EBADF on select().
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25 04:47:47 +00:00
matz
3410fd6812
* README.EXT.ja, dir.c, eval.c, eval_intern.h, lex.c.src,
...
lex.c.blt, keywords, load.c, thread.c: more ANSI'ize.
a patch from Tadashi Saito <shiba AT mail2.accsnet.ne.jp>
in [ruby-dev:32725]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25 04:17:06 +00:00
ko1
5f0b8afb97
* vm_core.h, thread.c, cont.c: add RUBY_VM_SET_INTERRUPT(),
...
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
2007-12-25 04:16:06 +00:00
nobu
97cdb5ac25
* load.c (load_lock): reverted.
...
* thread.c (rb_barrier_wait): check for recursive wait.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24 08:59:31 +00:00
akr
e01c045a8b
enable several rdoc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24 07:52:39 +00:00
nobu
7521299325
* thread.c (rb_thread_atfork): should not leave living_threads
...
referring freed table while allocating new table.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24 04:43:38 +00:00
ko1
6cbc9ac208
* thread.c (rb_thread_atfork): fix to mark thread object.
...
[ruby-dev:32404]
* bootstraptest/test_knownbug.rb, test_fork.rb: move a fixed test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21 08:27:14 +00:00
ko1
c334a09f7a
* common.mk, *.ci: renamed to *.c.
...
* eval_laod.c: renamed to load.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-20 09:29:46 +00:00
ko1
314bef7ef1
* insnhelper.ci, vm.c, vm_core.h: change interface of
...
vm_invoke_block() to specify block ptr. [ruby-talk:266422]
* cont.c, eval_jump.ci, insns.def, proc.c, signal.c, thread.c:
apply above change.
* bootstraptest/test_knownbug.rb: move fixed bug.
* bootstraptest/test_block.rb: ditto. and add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-20 07:07:35 +00:00
nobu
62c94002ef
* thread.c (recursive_pop): use object ID.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-07 06:04:03 +00:00
nobu
ff2ec563b2
* thread.c (rb_exec_recursive): use Hash instead of Array for
...
performance improvement. [ruby-core:13898]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-07 03:22:28 +00:00
nobu
360a674fe5
* thread.c (thread_initialize): fixed typo.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-05 07:43:08 +00:00
nobu
430f5a1d61
* proc.c (rb_proc_s_new): call initialize. [ruby-core:13824]
...
* proc.c (rb_proc_location): return file name and line number where
the proc is defined.
* thread.c (thread_s_new): call initialize. [ruby-core:13835]
* thread.c (thread_initialize): split initialize method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-05 07:18:52 +00:00
nobu
8ea5018d20
* parse.y (yycompile): get rid of tracing while parsing.
...
[ruby-dev:31351]
* thread.c (ruby_suppress_tracing): added a new parameter, which
directs to call func always.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-05 04:41:27 +00:00
matz
c227d3feb3
* insnhelper.ci (vm_search_normal_superclass): rename function.
...
* insnhelper.ci (vm_search_superclass): ditto.
* proc.c (struct METHOD): rename rklass -> rclass.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-22 01:17:52 +00:00
ko1
c79ab68d37
* vm.c: fix to recycle thread data (VM stack).
...
* thread.c: ditto.
* benchmark/bm_vm3_thread_create_join.rb: add loop count.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-21 09:06:06 +00:00
ko1
3453b2bd0e
* gc.h, vm_core.h: decl of rb_gc_save_machine_context()
...
should be at vm_core.h.
* include/ruby/ruby.h, intern.h: remove type rb_thread_t.
* include/ruby/intern.h: change rb_unblock_function_t,
rb_unblock_function_t.
* file.c, process.c: apply above changes.
* thread.c, thread_pthread.ci, thread_win32.ci: ditto.
* io.c: support blocking open (2). [ruby-core:13614]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-20 10:47:53 +00:00
ko1
d907cbc81d
* blockinlining.c, compile.c, compile.h, debug.c, debug.h,
...
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-13 22:13:04 +00:00
usa
fef818ec82
* thread.c (call_trace_proc): should return value.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-12 10:47:46 +00:00
shugo
577eaa60a7
* insnhelper.ci (vm_call_method): pass mn->nd_clss to
...
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-11 08:42:13 +00:00
shugo
66c127bc6f
* thread.c (call_trace_proc): don't call ID2SYM() for ID_ALLOCATOR
...
to avoid SEGV.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-10 08:33:28 +00:00
nobu
bb1f1c5782
* eval_load.c (rb_feature_p): check if the feature is loading with
...
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-11-06 06:52:01 +00:00
matz
07d12a2a5f
* vm_core.h (rb_vm_struct): fix typo: bufferd -> buffered.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-28 07:25:51 +00:00
ko1
6244e502cc
* thread.c: fix Mutex to be interruptable lock.
...
* 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-27 16:48:14 +00:00
ko1
6bf7d3d8c0
* prelude.rb: added. run this script on startup.
...
* 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-24 15:26:28 +00:00
nobu
f2f08335df
* vm_core.h (struct rb_thread_struct): removed first_func_arg and
...
reuse first_args instead.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-20 14:17:16 +00:00
nobu
6fc746d7e3
* thread.c (is_ruby_native_thread): check properly. [ruby-dev:31166]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 08:40:13 +00:00
ko1
e5d5f5a61a
* thread.c (rb_thread_terminate_all): fix to ignore
...
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-17 07:24:03 +00:00
ko1
d7a19d0333
* thread.c (rb_thread_raise): check if target thread is
...
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-12 20:06:59 +00:00
nobu
1a7564a0ed
* thread.c (thread_start_func_2): not re-raise to main thread if it is
...
joining the current thread.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-10 15:01:14 +00:00
nobu
9242da9e02
* thread.c (thread_create_core): inherit the priority of creating
...
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-10 14:54:50 +00:00
nobu
2903ea4aeb
* thread.c (thread_start_func_2): let abort_on_exception work.
...
[ruby-core:11873]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-09 20:12:21 +00:00