summaryrefslogtreecommitdiff
path: root/thread.c
AgeCommit message (Collapse)Author
2011-05-07* thread.c (rb_fd_zero): remove redundant zero fill.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-07* thread.c (rb_fd_init): remove volatile qualifier.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-07* thread.c (rb_fd_init_copy): new internal api. It provide efficientkosaki
copy constructor semantics. * thread.c (do_select): use rb_fd_init_copy(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-07r31460 is wrong fix. fix it again.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-07fix incorrect native_cond_signal call when deadlock was detected.kosaki
* thread.c (lock_func): timedwait don't touch cond_waiting and cond_notifid variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-06 mutex: deadlock check timeout use monotonic time.kosaki
* thread_pthread.c (native_cond_timeout): new internal api. it calculate a proper time for argument of native_cond_timedwait(). * thread_win32.c (native_cond_timeout): ditto. * thread_pthread.c (thread_timer): use native_cond_timeout() instead of get_ts. * thread.c (lock_func): ditto. * thread_pthread.c (get_ts): removed. use native_cond_timeout(). * thread.c (init_lock_timeout): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-06* thread_pthread.h (rb_thread_cond_t): add clockid field. it'skosaki
no longer an alias of pthread_cond_t. * thread_pthread.c: adapt new rb_thread_cond_t type. * thread.c (mutex_alloc): ditto. * thread_win32.c (native_cond_initialize): ditto. * configure.in: add check for pthread_cond_attr_setclock() and clockid_t type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-06* thread.c (rb_wait_for_single_fd): use ppoll() instead of poll()kosaki
if possible. based on a patch from Eric Wong. [ruby-core:36003]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04* thread.c (rb_wait_for_single_fd): Fix wrong return value.kosaki
* test/-ext-/wait_for_single_fd/test_wait_for_single_fd.rb (TestWaitForSingleFD#test_wait_for_closed_pipe): test for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04* thread.c (rb_wait_for_single_fd): Added POLLNVAL check.kosaki
based on a patch from Eric Wong at [ruby-core:35991]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04* thread.c (rb_wait_for_single_fd): new. poll(2) based backend for ↵kosaki
rb_wait_for_single_fd(). Now only Linux uses it. The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04* thread.c (rb_wait_for_single_fd): new.kosaki
* thread.c (select_single): select(2) based backend for rb_wait_for_single_fd(). * io.c (make_writeconv): use rb_wait_for_single_fd() instaed of rb_thread_fd_select(). * io.c (rb_io_wait_readable): ditto. * thread.c (rb_thread_wait_fd_rw): ditto. * io.c (wait_readable): removed. * thread.c (init_set_fd): new helper function. * include/ruby/io.h (RB_WAITFD_IN, RB_WAITFD_PRI, RB_WAITFD_OUT): new constant for rb_single_wait_fd(). The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-03* thread.c (rb_fd_copy): fix wrong argument.This issue was pointedkosaki
out by Eric Wong. [ruby-core:35982] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-02* thread.c (rb_thread_select): preserve errno if no errornobu
occurred. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-30* thread.c (rb_thread_select): release GVL while waiting select().kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-30* thread.c (do_select): Change arugment type to rb_fdset_t.kosaki
Now do_select() is free from unexpected hangup if HAVE_RB_FD_INIT=1 [Bug #4636] * thread.c (rb_thread_fd_select, rb_thread_wait_fd_rw): adapt new argument type. * thread.c (rb_thread_select): make dummy implementation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-30* thread.c (rb_fd_copy): Change function argument. Nowkosaki
rb_fd_copy() has fully copy semantics. * include/ruby/intern.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-30* thread.c (do_select): remove useless ifdef. time calculationkosaki
is not heavy weight. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-29fix indentationkosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-29* thread.c (lock_func): small cleanup.kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-29* thread.c (rb_mutex_lock, lock_func): Avoid busy loop andkosaki
performance degression. bm_vm3_thread_mutex.rb performance change from 109.064sec to 16.331sec. * thread.c (init_lock_timeout): New helper function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-13 * thread.c (thread_fd_close_i): IOError exception should be assignednagachika
to rb_thread_t::thrown_errinfo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-20* thread.c (exec_recursive): prevent temporary objects from GC.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-14 * thread.c (rb_thread_io_blocking_region): reset th->waiting_fdnagachika
after blocking region, because remaining waiting_fd might cause unnecessary IOError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-12* thread.c (rb_thread_io_blocking_region): new function to runnobu
blocking region with GIL released, for fd. * thread.c (rb_thread_fd_close): implement. [ruby-core:35203] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-31 * thread.c (thread_start_func_2): check deadlock condition beforenagachika
release thread stack. fix memory violation when deadlock detected. reported by Max Aller. [Bug #4009] [ruby-core:32982] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-08* thread.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25 * thread.c (rb_thread_atfork): Add small comment why we needkosaki
reset random seed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-20 * thread.c (thread_cleanup_func): Moved interrupted_lockkosaki
destroying code from native_thread_destroy() to thread_cleanup_func() because it's platform independent logic. * thread_win32.c (native_thread_destroy): ditto. * thread_pthread.c (native_thread_destroy): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-20 * thread.c (thread_cleanup_func): Don't touch native threadingkosaki
resource at fork. Sadly this is purely bandaid. We need to implement proper fix later. [Bug #4169] [ruby-core:33767] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-27* thread.c, vm_core.h: make gvl_acquire/release/init/destructko1
APIs to modularize GVL implementation. * thread_pthread.c, thread_pthread.h: Two GVL implementations. (1) Simple locking GVL which is same as existing GVL. (2) Wake-up queued threads. The wake-up order is simple FIFO. (We can make several queues to support exact priorities, however this causes some issues such as priority inversion and so on.) This impl. prevents spin-loop (*1) caused on SMP environemnts. *1: Only one Ruby thread acqures GVL again and again. Bug #2359 [ruby-core:26694] * thread_win32.c, thread_win32.h: Using simple lock not by CRITICAL_SECTION but by Mutex. Bug #3890 [ruby-dev:42315] * vm.c (ruby_vm_destruct): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* configure.in (RUBY_CHECK_PRINTF_PREFIX): check for printf formatnobu
specifier if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* compile.c (iseq_build_body), error.c (set_syserr, get_syserr),nobu
(syserr_initialize), gc.c (define_final, rb_gc_copy_finalizer), (run_final), hash.c (rb_hash_aref, rb_hash_lookup2), (rb_hash_fetch_m, rb_hash_clear, rb_hash_aset, eql_i), iseq.c (iseq_load, iseq_data_to_ary), marshal.c (r_symlink), thread.c (rb_thread_local_aref), variable.c (generic_ivar_remove, ivar_get, rb_const_get_0), (rb_cvar_get), vm.c (rb_vm_check_redefinition_opt_method), vm_insnhelper.c (vm_get_ev_const), vm_method.c (remove_method), ext/iconv/iconv.c (map_charset): use st_data_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-09* vm_core.h (rb_signal_buff_size, rb_signal_exec): movednobu
declarations from thread.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-09* thread.c (thread_reset_event_flags, exec_event_hooks): ignorenobu
hooks marked as removed. * thread.c (thread_exec_event_hooks): remove hooks to be removed. * thread.c (rb_threadptr_remove_event_hook, rb_remove_event_hook): defer removing hooks if running the hooks. [ruby-dev:42350] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-09* thread.c (rb_threadptr_exec_event_hooks): suppress each eventnobu
hooks separately. * thread.c (thread_suppress_tracing): split from ruby_suppress_tracing, accepting thread pointer and event mask. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-08* thread.c (rb_threadptr_remove_event_hook): fix typo.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-03* enc/unicode.c (onigenc_unicode_property_name_to_ctype):naruse
remove useless assignment. * vm.c (vm_make_proc_from_block): ditto. * variable.c (rb_ivar_count): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-01* thread.c (ruby_suppress_tracing): restore the state and invokenobu
the func with normal state. a patch from Satoshi Shiba <shiba AT rvm.jp> at [ruby-dev:42162]. [ruby-core:31783] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-14* thread.c (rb_gc_mark_threads): deprecated.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-18* include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu
add parent member. * error.c (rb_typeddata_inherited_p): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-17* thread.c (rb_thread_wakeup_alive): split from rb_thread_wakeup.nobu
merged from r13476. c.f. [ruby-core:31320] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-28* thread.c (rb_fd_resize, rb_fd_copy): avoid NULL dereference uponmame
failed realloc by using xrealloc instead of not realloc. a patch from Jim Meyering <meyering at redhat.com> in [ruby-core:30920] [Bug #3489] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-07* thread.c (Init_Thread): no need to suppress warning fornobu
ruby_thread_set_native anymore. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-05* vm.c (Init_BareVM): call Init_native_thread here.akr
* thread.c (Init_Thread): don't call Init_native_thread. * thread_pthread.c (Init_native_thread): exported. * thread_win32.c (Init_native_thread): ditto. [ruby-dev:41536] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29* removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29* thread.c (RB_GC_SAVE_MACHINE_CONTEXT), gc.c (ruby_gc_stress_start):tarui
revert r28078. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29* thread.c (RB_GC_SAVE_MACHINE_CONTEXT): start GC tarui
by switching the thread if gc_stress == true * gc.c (ruby_gc_stress_start): dotto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-28 * thread.c (blocking_region_begin): avoid RUBY_VM_CHECK_INTS()kosaki
call during GVL state transition. [Bug#3354] [ruby-dev:41435] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-20* thread.c (subtract_tv): if the rest is zero, should finish waitingusa
immediately. * win32/win32.c (subtract): ditto. based on a patch from Roger Pack in [ruby-core:27957]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e