summaryrefslogtreecommitdiffstats
path: root/thread.c
Commit message (Collapse)AuthorAgeFilesLines
* * 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: http://svn.ruby-lang.org/repos/ruby/trunk@25316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: Doc fix for Thread#raisemarcandre2009-10-111-1/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_threadptr_errinfo): renamed.nobu2009-10-101-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: added rdocs.nobu2009-09-171-0/+50
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@24943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thread_list_access): prototyped.nobu2009-09-131-1/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@24717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (do_select): suppress warnings.naruse2009-08-301-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@24692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (do_select): suppress warnings.nobu2009-08-261-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@23557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: fixed types.nobu2009-05-091-6/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@22577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thread_start_func_2): do not delete main thread fromnobu2009-02-181-6/+8
| | | | | | | living_threads. [ruby-core:19385], [ruby-core:22158] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: inline should be at beginning of declaration.nobu2009-02-121-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (rb_fiber_current), dln.c (dln_print_undef, dln_undefined),nobu2009-02-011-3/+3
| | | | | | | | | | | eval.c (rb_iterator_p, rb_need_block), load.c: (Init_load), ruby.c (uscore_get, rb_f_chop), st.c (stat_col), signal.c (rb_signal_buff_size, ruby_sig_finalize), thread.c (rb_thread_sleep_forever, rb_thread_sleep_deadly, rb_thread_alone): protoized. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_time_timeval): made a real prototype. a patch fromnobu2009-01-221-1/+1
| | | | | | | Marcus Rueckert <darix AT opensu.se> at [ruby-core:21492]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_execute_interrupts): needsnobu2009-01-191-0/+1
| | | | | | | rb_signal_buff_size to be declared. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c: add a prefix "rb_" to exposed functionsko12009-01-191-3/+3
| | | | | | | | | | | | | | | | | vm_get_ruby_level_next_cfp(), rb_vm_make_env_object(), vm_stack_to_heap(), vm_make_proc(), vm_invoke_proc(), vm_get_sourceline(), vm_cref(), vm_localjump_error(), vm_make_jump_tag_but_local_jump(), vm_jump_tag_but_local_jump(). This changes may affect only core because most of renamed functions require a pointer of not-exposed struct such as rb_thread_t or NODE. In short, they are core functions. * cont.c, eval.c, eval_intern.h, load.c, proc.c, thread.c, vm_core.h, vm_dump.c, vm_eval.c, vm_exec.c, vm_insnhelper.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thread_start_func_2): call ruby_cleanup() if thread isko12009-01-161-1/+1
| | | | | | | | main thread. [ruby-dev:37624] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_execute_interrupts): if signal is alreadymame2009-01-151-2/+7
| | | | | | | | | | buffered, main thread should wait until timer thread delivers it. * thread.c (timer_thread_function): should defer delivery of a signal if main thread does not yet trap a previous one. [ruby-dev:37676] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (call_trace_proc): as Matz said ([ruby-core:21183]),ko12009-01-151-2/+3
| | | | | | | | | | should skip rb_str_new2() if rb_sourcefile() returns NULL. rb_sourcefile() returns NULL if frame is toplevel of Fiber. [ruby-core:21161] [Bug #985] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h, thread.c, win32/Makefile.sub (rb_fdset_t,usa2009-01-131-0/+46
| | | | | | | | | | | | | | | rb_fd_init, rb_fd_term, rb_fd_zero, rb_fd_set, rb_fd_clr, rb_fd_isset, rb_fd_select, rb_fd_ptr, rb_fd_max, HAVE_RB_FD_INIT): new type, functions, and macros for Windows. * win32/win32.c (extract_fd, rb_w32_select): use rb_fdset_t to expand fd_array if needed. [ruby-core:19946] * win32/win32.c (copy_fd): new funcion for rb_w32_select(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: fix comment (terminology: Global VM Lock).ko12009-01-121-6/+40
| | | | | | | | | | | | * thread.c (blocking_region_begin, blocking_region_end): save and clear th->blocking_region_buffer. * thread.c (rb_thread_call_with_gvl): check if it has GVL. * thread.c (ruby_thread_has_gvl_p): added. * vm_core.h: add decls. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rdoc update.kazu2009-01-051-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_blocking_region): add a comment.ko12008-12-301-1/+72
| | | | | | | | | | | | * thread.c (rb_thread_call_without_gvl): added as a alias of rb_thread_blocking_region(). * thread.c (rb_thread_call_with_gvl): added. * vm_core.h (rb_thread_t#blocking_region_buffer): added for rb_thread_call_with_gvl(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_mutex_trylock): return false if Mutex ownedko12008-12-291-4/+5
| | | | | | | | | | by current thread. [ruby-core:20943] * thread.c (rb_mutex_lock): check dead lock (recursive lock) here. * test/ruby/test_thread.rb: add a test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (mutex_free, mutex_unlock): add qualifiers.mame2008-12-281-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (mutex_free): GC thread (main thread) has failed to unlockmame2008-12-281-7/+7
| | | | | | | | | | | | a mutex that is locked by another thread, which makes the mutex dangling in keeping_mutexes and causes [BUG] or stuck finally. Now unlocking is performed as locking thread. * thread.c (mutex_unlock, rb_mutex_unlock, rb_mutex_unlock_all): mutex_unlock receives a thread. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (after_exec): needs to reset before restart timernobu2008-12-271-0/+3
| | | | | | | | | | thread. * thread.c (thread_start_func_2): stops timer thread if forked in the new thread. [ruby-core:19385] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_atfork, rb_thread_atfork_before_exec): DRY.nobu2008-12-271-24/+21
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e