summaryrefslogtreecommitdiff
path: root/thread.c
AgeCommit message (Collapse)Author
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
2008-06-20* string.c (rb_memhash): randomize hash to avoid algorithmicakr
complexity attacks. (rb_str_hash): use rb_memhash. * include/ruby/intern.h (rb_reset_random_seed): declared. * thread.c (rb_thread_atfork): call rb_reset_random_seed. * inits.c (rb_call_inits): call Init_RandomSeed at first. * random.c (seed_initialized): defined. (fill_random_seed): extracted from random_seed. (make_seed_value): extracted from random_seed. (rb_f_rand): initialize random seed at first. (initial_seed): defined. (Init_RandomSeed): defined. (Init_RandomSeed2): defined. (rb_reset_random_seed): defined. (Init_Random): call Init_RandomSeed2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-19* thread.c: try to remove false positive of deadlock detection (secondmame
trial). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-19* thread.c, thread_win32.c, vm_core.h: try to remove false positive ofmame
deadlock detection. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-16* thread.c (thread_start_func_2): use PRIxVALUE to format a VALUE.nobu
* thread.c (ruby_native_thread_p): removed unused declaration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-15* vm_core.h, thread.c: rename global_interpreter_lock toko1
global_vm_lock. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-14* gc.h (STACK_UPPER): moved from gc.cnobu
* thread.c, thread_{pthread,win32}.c (ruby_init_stack, ruby_thread_init_stack): moved stack initialization from gc.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-12* thread.c (mutex_unlock): fix cond_notified consistency.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-12* thread.c, vm_core.h, vm.c, thread_pthread.c, thread_win32.c: addmame
deadlock detection. [ruby-dev:35044] * bootstraptest/test_thread.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-10* include/ruby/intern.h, proc.c: revert rb_proc_call() andko1
create rb_proc_call_with_block() instaed. * include/ruby/ruby.h, eval_jump.c, thread.c, vm_insnhelper.c: rb_blockptr should not be exposed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09* include/ruby/ruby.h, vm_core.h: add a type rb_blockptr.mame
* vm_insnhelper.c (vm_yield_with_cfunc): vm_yield_with_cfunc receives blockptr and passes it to iterating block. * proc.c (rb_proc_call), include/ruby/intern.h: rb_proc_call receives blockptr. "rb_proc_call(self, args, blockptr)" in C corresponds to "self.call(*args, &block)" in Ruby. * proc.c (proc_call): pass blockptr to block that is written in C. * proc.c (curry): receive blockptr and pass it to original proc. [ruby-core:15551] * vm.c (invoke_block_from_c): fix for change of vm_yield_with_cfunc. * thread.c (call_trace_proc), eval_jump.c (rb_call_end_proc): fix for change of rb_proc_call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09* include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu
* *.c: no cache in init functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08* array.c, bignum.c, cont.c, dir.c, dln.c, encoding.c, enumerator.c,ko1
enumerator.c (enumerator_allocate), eval_jump.c, file.c, hash.c, io.c, load.c, pack.c, proc.c, random.c, re.c, ruby.c, st.c, string.c, thread.c, thread_pthread.c, time.c, util.c, variable.c, vm.c, gc.c: allocated memory objects by xmalloc (ruby_xmalloc) should be freed by xfree (ruby_xfree). * ext/curses/curses.c, ext/dbm/dbm.c, ext/digest/digest.c, ext/gdbm/gdbm.c, ext/json/ext/parser/parser.c, ext/json/ext/parser/unicode.c, ext/openssl/ossl_cipher.c, ext/openssl/ossl_hmac.c, ext/openssl/ossl_pkey_ec.c, ext/sdbm/init.c, ext/strscan/strscan.c, ext/zlib/zlib.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-05* eval.c (ruby_finalize_0): clear trace_func after executing ENDmame
procs. * thread.c: fix typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-05* thread.c (thread_set_trace_func_m): fix check for proc argument.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-01* suppress warnings on cygwin, mingw and mswin.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31* suppress warnings with -Wwrite-string.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-30* vm_core.h (struct rb_unblock_callback), thread.cnobu
(set_unblock_function), thread_{pthread,win32}.c (native_sleep): extracted from struct rb_thread_struct. * thread.c (reset_unblock_function): not check interrupts at leaving blocking region. [ruby-dev:34874] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-27* thread.c (rb_thread_execute_interrupts): delay interrupts duringnobu
raising exceptions. [ruby-dev:34855] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e