summaryrefslogtreecommitdiff
path: root/thread.c
AgeCommit message (Collapse)Author
2008-11-13* thread.c (rb_barrier_wait): gets rid of recursive deadlock.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-12* thread.c (rb_barrier_{new,wait,release,destroy}): use Mutex so thatnobu
circular requires fail with deadlock. [ruby-core:19821] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-11* load.c (rb_require_safe): destroys barrier after successfullynobu
loaded, to get rid of loading same library again. [ruby-core:19798] * thread.c (rb_barrier_wait): can not wait destroyed barrier. * thread.c (rb_barrier_destroy): destroys barrier so that no longer waited. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-08* thread_pthread.c (thread_timer): checks working flags again.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-06* thread.c (rb_thread_stop_timer_thread): terminates timer threadnobu
immediately. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-03* include/ruby/intern.h (rb_mutex_synchronize): fixed prototype.nobu
* thread.c (rb_mutex_synchronize): fixed function name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-26* thread.c (blocking_region_{begin,end}): declared as inline.nobu
* util.c (freedtoa): used only when MULTIPLE_THREADS is not defined. * win32/win32.c (rb_w32_pipe): serial is DWORD. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-08* thread.c (rb_thread_wait_fd_rw): should not block by select ifmatz
there's only one thread living. fixed [ruby-dev:36646]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-26* thread.c (thlist_signal): clears the woken thread if nothing woke.nobu
* thread.c (rb_barrier_wait): achieves the lock if no thread was waiting yet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-26* include/rubysig.h: old macros for backward compatibility.nobu
* thread.c (BLOCKING_REGION): rewritten using helper functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* thread.c (rb_thread_blocking_region): fix typo in a document.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* thread.c (rb_thread_blocking_region): write a documentko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* thread.c, include/ruby/intern.h (rb_thread_interrupted): added.ko1
* io.c: use VALUE of thead instead of rb_tread_t to check interrupts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* common.mk: clean upko1
- remove blockinlining.$(OBJEXT) to built - make ENCODING_H_INCLDUES variable (include/ruby/encoding.h) - make VM_CORE_H_INCLUDES variable (vm_core.h) - simplify rules. - make depends rule to output depend status using gcc -MM. * include/ruby/mvm.h, include/ruby/vm.h: rename mvm.h to vm.h. * include/ruby.h: ditto. * load.c: add inclusion explicitly. * enumerator.c, object.c, parse.y, thread.c, vm_dump.c: remove useless inclusion. * eval_intern.h: cleanup inclusion. * vm_core.h: rb_thread_t should be defined in this file. * vm_evalbody.c, vm_exec.c: rename vm_evalbody.c to vm_exec.c. * vm.h, vm_exec.h: rename vm.h to vm_exec.h. * insnhelper.h, vm_insnhelper.h: rename insnhelper.h to vm_insnhelper.h. * vm.c, vm_insnhelper.c, vm_insnhelper.h: - rename vm_eval() to vm_exec_core(). - rename vm_eval_body() to vm_exec(). - cleanup include order. * vm_method.c: fix comment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* iseq.c (iseq_data_to_ary): make it static.ko1
* thread.c (thgroup_enclose): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* thread.c (rb_thread_critical): removed.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* thread.c (rb_thread_check_trap_pending): added for compatibility.ko1
* ext/tk/tcltklib.c, ext/tk/tkutil/tkutil.c: remove ruby/signal.h dependency. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* vm_core.h (struct rb_vm_struct): replaced signal staff with trapnobu
staff. * signal.c (signal_buff): per process resouce now. * signal.c (trap_list): moved to VM. * signal.c (rb_get_next_signal): reverted. * signal.c (rb_trap_exit): trap_pending_list was no longer used. * thread.c (timer_thread_function): delivers buffered per-process signals to each VMs. * vm.c (rb_vm_mark): marks trap_list. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31fix a typo.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31* include/ruby/intern.h: rename RB_UBF_DFL toko1
RUBY_UBF_IO and RUBY_UBF_PROCESS. Because there is no default (universal) unblocking function. * ext/socket/socket.c, file.c, io.c, process.c, thread.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-16* include/ruby/ruby.h (rb_intern_const): tiny optimization.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-14* thread.c (rb_thread_priority_set): get rid of C99 feature.nobu
* transcode.c (transcode_search_path): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13* thread.c (rb_thread_execute_interrupts): switch eventko1
should be occur only once. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13* thread.c (rb_thread_check_ints): added. please note thatko1
this function may cause ruby's thread switching. * include/ruby/intern.h: ditto. * regint.h: use rb_thread_check_ints() instead of RUBY_CHECK_INTS() directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13* thread.c, vm_core.h: add manual priority supportko1
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
2008-08-05* thread.c (thread_start_func_2): propagates fatal error and systemnobu
exit to the main thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-30* thread.c (rb_mutex_unlock_all): mutex is no longer a ruby object.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-30* win32/win32.c (rb_w32_select): recalc the rest of timeout for eachnobu
iterations. [ruby-core:18015] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-28 * thread_win32.[ch] (cond_every_entry, rb_thread_cond_struct): revertedusa
r18239 because r18245 made the changes unnecessary. * thread.c (rb_mutex_struct): define after including thread_{pthread, win32}.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-28* vm_core.h: move the definition of struct rb_mutex_struct.mame
* thread.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-28* thread.c (mutex_unlock): fix typo.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-27* vm_core.h, thread.c: It is now prohibited to use Data_Get_Struct inmame
*_free against an object that is going to be free'ed. So, change type of thread_t#keeping_mutexes from VALUE to mutex_t. * vm.c: remove mark to keeping_mutexes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-27* include/ruby/ruby.h: add a type T_DEFERRED.ko1
* gc.c: fix deferred finalizer system. finalize processes of T_DATA and T_FILE are executed after gc process. And fix to use BUILTIN_TYPE() instead of seeing flag. * thread.c, vm_core.h: add RUBY_VM_SET_FINALIZER_INTERRUPT() and check intterupt_flag at rb_thread_execute_interrupts(). * thread.c (mutex_mark): fix to mark next_mutex. * vm.c (rb_thread_mark): fix to mark keeping_mutexes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-16* thread.c (thread_start_func_2): wake up joining threads.nobu
* thread.c (sleep_forever, sleep_timeval): return when interrupted. [ruby-dev:35542] * thread.c (timer_thread_function): restore main thread status. [ruby-core:17270] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-11* io.c (rb_io_wait_readable, rb_io_wait_writable): check if the filenobu
descriptor is closed. * thread.c (rb_thread_wait_fd_rw): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-10* thread.c (thread_create_core): fix GC problem.ko1
[ruby-core:17669] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-10* thread.c (rb_thread_wait_for): fixed variable name.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-10* thread.c (rb_thread_wait_for): wait until timed out only whennobu
sleeping with timeout. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-09* thread.c (sleep_forever): wait until timed out. [ruby-core:17270]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-09* configure.in (rb_cv_va_args_macro): check for __VA_ARGS__.nobu
* thread.c (thread_debug): show source name and line if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-09* thread_{pthread,win32}.c (rb_thread_create_timer_thread): needs morenobu
stack for debug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-08* thread.c (rb_set_coverages, rb_reset_coverages): enable and disablemame
coverage measurement. * thread.c (rb_get_coverages): rename and move from vm.c. * vm.c (rb_vm_get_coverages): ditto. * iseq.c (prepare_iseq_build): ditto. * thread.c (clear_coverage): ditto. * parse.y (coverage): ditto. * ext/coverage/coverage.c: use above functions, add new method Coverage.start and fix rdoc . git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-08* thread.c (rb_enable_coverages): hide coverage array by setting 0 tomame
klass during measurement. * parse.y (coverage, yycompile0): ditto. * iseq.c (prepare_iseq_build): use rb_hash_lookup instead of rb_hash_aref. * thread.c (rb_coverage_result): restore klass of coverage array and return it. * theaad.c (update_coverage): chcek whether its klass is 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-05* thread.c (thread_initialize): NUM2INT() returns int.nobu
* thread.c (timer_thread_function), thread_pthread.c (thread_timer), thread_win32.c (timer_thread_func), thread_{pthread,win32}.c (rb_thread_create_timer_thread): passing VM. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-03* include/ruby/intern.h: remove prototypes about coverage.mame
* iseq.c (prepare_iseq_build): add prototype. * parse.y (coverage): ditto. * thread.c (clear_coverage): ditto. * thread.c (update_coverage): use rb_sourceline. * thread.c (rb_get_coverages): rename and move to vm.c. * vm.c (rb_vm_get_coverages): ditto. * ext/coverage/coverage.c: add rdoc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-03* ext/coverage/coverage.c, ext/coverage/extconf.rb: eliminatemame
COVERAGE__ and introduce coverage.so instead. How to measure coverage: (1) require "coverage.so", (2) require or load Ruby source file, and (3) Coverage.result will return the same hash as COVERAGE__. [ruby-dev:35324] * thread.c (rb_enable_coverages): start coverage measurement by using rb_add_event_hook. * thread.c (rb_get_coverages): returns current results of coverage measurement. * include/ruby/intern.h: add prototype for above two functions. * vm_core.h, vm.c: add field of coverages to rb_vm_t. * insns.def (trace): remove special handling for COVERAGE__. * iseq.c (prepare_iseq_build): switch COVERAGE__ to rb_get_coverages(). * parse.y (coverage): ditto. * thread.c (clear_coverage): ditto. * lib/coverage.rb: use coverage.so instead of COVERAGE__. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-03* thread.c (thread_initialize): NUM2INT returns long.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-01* compile.h, insns.def: reduce insn operand of "trace".ko1
* include/ruby/ruby.h: add RUBY_EVENT_COVERAGE event. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-01* Add coverage measurement constant COVERAGE__. This constant is notmame
for casual use. Usage: (1) assign {} to COVERAGE__, (2) require or load Ruby source file, and (3) COVERAGE__["sourcefilepath"] will return an array whose elements represent number of executions per line of source code. * vm_core.h: add field of coverage array to iseq. * iseq.c (prepare_iseq_build): ditto. * insns.def (trace): update coverage array. * parse.y (coverage): create and initialize coverage array. * compile.h (ADD_TRACE): add trace instruction to update covearge array. * thread.c (clear_coverage): delete coverage array when forking. Otherwise, double count of coverage may occur. * lib/coverage.rb: sample coverage measurement tool. * error.c: distinguish explicitly between parse_in_eval and mild_compile_error. * load.c: ditto. * vm_eval.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-01* iseq.c (COMPILE_OPTION_FALSE), time.c (timegm_noleapsecond),nobu
thread.c (eKillSignal, eTerminateSignal), missing/vsnprintf.c (BSD_vfprintf): constified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e