summaryrefslogtreecommitdiff
path: root/thread.c
AgeCommit message (Collapse)Author
2011-06-18* eval.c, hash.c, load.c, proc.c, range.c, thread.c, time.c: don'takr
declare internal functions. * internal.h, vm_core.h: declare internal functions. * array.c: include internal.h. * common.mk: update dependency for array.o. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* method.h, internal.h iseq.h: declare internal functions.akr
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c, thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't declare internal functions. Note that rb_method_entry_eq() is defined in vm_method.c but there was a declaration in proc.c with different const-ness. Now it is declared in method.h with same const-ness to the definition. * object.c (rb_mod_module_exec): don't declare functions declared in include/ruby/intern.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* internal.h: declare more internal functions.akr
* iseq.h (rb_method_get_iseq): declared. * compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c, ruby.c, time.c, util.c, vm.c: don't declare internal functions. * eval.c, parse.y, thread_pthread.c: non-existing function declarations removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* internal.h: declare internal functions here.akr
* node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-16* thread.c (rb_thread_schedule_rec): fix {UN,}LIKELY macro misuse.kosaki
* gc.c (rb_newobj): ditto. * vm_insnhelper.c (vm_method_search): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-16* fix for build on solaris 10.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-15* thread.c (do_select): Windows: no need to poll if select(2) isusa
cancelable. * thread_win32.c (native_fd_select): new function to make select(2) cancelable. * thread_win32.c (rb_w32_check_interrupt): new function for checking interrupt. * win32/win32.c (rb_w32_select_with_thread): new function. cancelable select(2). * win32/win32.c (rb_w32_select): use above function internally. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-15* thread.c: remove BLOCKING_REGION_CORE() macro. It's no longer usedkosaki
since r32021. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-13* thread.c (rb_thread_schedule_rec): call gvl_yield() unconditionally.kosaki
* thread_pthread.c: remove HAVE_GVL_YIELD macro. * thread_win32.c (gvl_yield): new. this fallback logic was moved from rb_thread_schedule_rec(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-13* thread_pthread.c: rewrite GVL completely.kosaki
* thread_win32.c: ditto. * thread_pthread.h: ditto. * vm_core.h: ditto. * thread.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-12* thread.c: remove th->transition_for_lock. It's thread unsafe.kosaki
[Bug #4723][ruby-dev:43563] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-12* thread.c: introduce spurious wakeup safe deadlock check.kosaki
[Bug #4696][ruby-dev:43554] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-11* vm_core.h (RUBY_VM_SET_TIMER_INTERRUPT, RUBY_VM_SET_INTERRUPT,kosaki
RUBY_VM_SET_FINALIZER_INTERRUPT): use atomic ops for preventing interrupt_flag bit lost. * thread.c (rb_threadptr_execute_interrupts_rec): ditto. * vm_core.h (typedef struct rb_thread_struct): change type of interrupt_flag to rb_atomic_t. * atomic.h: move atomic ops definition from signal.c. * signal.c: remove atomic ops definition. * common.mk (gc, signal, thread, cont): add to dependency to atomic.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-11* thread.c (rb_thread_execute_interrupts): use GetThreadPtr to extractakr
rb_thread_t from VALUE. reorted by Motohiro KOSAKI. [ruby-dev:43700] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-09* io.c: fix IO.copy_stream interrupt handling.akr
based on the patch by Eric Wong. [ruby-core:36156] * vm_core.h (rb_thread_call_with_gvl): don't declare here. * thread.c: include internal.h. (rb_thread_execute_interrupts): new function. * internal.h (rb_thread_execute_interrupts): declared. (rb_thread_call_with_gvl): declared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-09* gc.c (rb_objspace_call_finalizer): use rb_typeddata_is_kind_of() fornagachika
type check to get rid of a double free when main Thread has singleton class. [ruby-core:36741] [Bug #4828] * thread.c (rb_obj_is_mutex): add a new utility function. * vm.c (rb_obj_is_thread): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-26* thread.c (ppoll): typo bug fix.nagai
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-21* thread.c (Init_Thread): add a code comment why the meaninglesskosaki
line is necessary. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-18* eval.c (setup_exception): internal exception should be hiddennobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-17* thread.c (rb_mutex_lock): remove remove_signal_thread_list() call.kosaki
It's meaningless because lock_interrupt doesn't call add_signal_thread_list(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15* include/ruby/intern.h: resurrect old rb_fd_copy().kosaki
* thread.c (rb_fd_copy): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15* include/ruby/intern.h: remove rb_fd_copy() to rb_fd_dup() andkosaki
rb_w32_fdcopy() to rb_w32_fd_dup(). * win32/win32.c: ditto. * thread.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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