aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
Commit message (Collapse)AuthorAgeFilesLines
...
* * *.c, parse.y, insns.def: use RARRAY_AREF/ASET macroko12013-05-131-9/+9
| | | | | | | | instead of using RARRAY_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: id localsnobu2013-05-021-4/+6
| | | | | | | | * thread.c (id_locals): use cached ID. * vm.c (ruby_thread_init): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add comments.akr2013-04-291-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: fix typos and documentationeregon2013-04-271-23/+23
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (SIGNED_INTEGER_TYPE_P): New macro.akr2013-04-271-4/+2
| | | | | | | | | | | | | | | (SIGNED_INTEGER_MAX): Ditto. (SIGNED_INTEGER_MIN): Ditto. (UNSIGNED_INTEGER_MAX): Ditto. (TIMET_MAX): Use SIGNED_INTEGER_MAX and UNSIGNED_INTEGER_MAX. (TIMET_MIN): Use SIGNED_INTEGER_MIN. * thread.c (TIMEVAL_SEC_MAX): Use SIGNED_INTEGER_MAX. (TIMEVAL_SEC_MIN): Use SIGNED_INTEGER_MIN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (TIMEVAL_SEC_MAX, TIMEVAL_SEC_MIN): Consider environments,akr2013-04-271-3/+13
| | | | | | | | sizeof(time_t) is smaller than sizeof(tv_sec), such as OpenBSD 5.2 (amd64). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: fix overflow on Windowsnobu2013-04-171-11/+12
| | | | | | | * thread.c (sleep_timeval): get rid of overflow on Windows where timeval.tv_sec is not time_t but mere long. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (MUL_OVERFLOW_SIGNED_INTEGER_P): New macro.akr2013-04-091-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | (MUL_OVERFLOW_FIXNUM_P): Ditto. (MUL_OVERFLOW_LONG_P): Ditto. * array.c (rb_ary_product): Don't overflow on signed integer multiplication. * numeric.c (fix_mul): Ditto. (int_pow): Ditto. * rational.c (f_imul): Ditto. * insns.def (opt_mult): Ditto. * thread.c (sleep_timeval): Don't overflow on signed integer addition. * bignum.c (rb_int2big): Don't overflow on signed integer negation. (rb_big2ulong): Ditto. (rb_big2long): Ditto. (rb_big2ull): Ditto. (rb_big2ll): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix documentation by @jc00ke [fix GH-278]hsbt2013-04-091-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: no allocate before deletingnobu2013-04-051-3/+4
| | | | | | | * thread.c (rb_thread_local_aset): no needs to allocate local_storage before deleting. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: avoid inadvertent symbol creationnobu2013-04-041-7/+14
| | | | | | | | | * thread.c (rb_thread_aref): avoid inadvertent symbol creation. (rb_thread_variable_get): ditto. (rb_thread_key_p): ditto. (rb_thread_variable_p): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: error messagenobu2013-04-041-1/+1
| | | | | | | * thread.c (rb_thread_variable_get): fix error message. getter doesn't modify thread variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: TYPEOF_TIMEVAL_TV_SECnobu2013-03-301-5/+16
| | | | | | | | | | * configure.in (TYPEOF_TIMEVAL_TV_SEC): check for x64-mingw, where timeval.tv_sec is not time_t. * thread.c (double2timeval): use TYPEOF_TIMEVAL_TV_SEC to get rid of overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timev.h: move time_t stuffsnobu2013-03-301-0/+1
| | | | | | | | * timev.h (TYPEOF_TIMEVAL_TV_SEC, unsigned_time_t): move from time.c. * thread.c: use definitions in timev.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: format specifiers for time_tnobu2013-03-301-3/+3
| | | | | | | | * thread.c (sleep_timeval): fix format specifiers for time_t. * time.c (DEBUG_REPORT_GUESSRANGE): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: Mutex#synchronize no block paramsnobu2013-03-291-1/+1
| | | | | | | | * thread.c (rb_mutex_synchronize_m): yield no block params. patch by splattael (Peter Suschlik) in [ruby-core:53773] [Bug #8097]. fix GH-266. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h (TIMET_MAX_PLUS_ONE): Defined.akr2013-03-261-8/+12
| | | | | | | | * thread.c (double2timeval): Saturate out-of-range values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: Define TIMET_MAX and TIMET_MIN here.akr2013-03-261-3/+0
| | | | | | | | | | | | | | * time.c: Remove TIMET_MAX and TIMET_MIN definitions. * thread.c: Ditto. * thread_pthread.c: Remove TIMET_MAX definition. * thread_win32.c: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (double2timeval): convert the infinity to TIME_MAX to avoidakr2013-03-261-3/+9
| | | | | | | | | SEGV by Thread.new {}.join(Float::INFINITY) on Debian GNU/Linux (amd64). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: fix deadlocknobu2013-03-211-2/+3
| | | | | | | * thread.c (ruby_kill): get rid of deadlock on signal 0. [ruby-dev:47182] [Bug #8137] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (ruby_kill): added a few comments.kosaki2013-03-191-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (ruby_kill): release GVL while waiting signal delivered.kosaki2013-03-191-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby_kill (internal.h, thread.c): use rb_pid_t instead of pid_t.usa2013-03-191-1/+1
| | | | | | | this fixes the build failure of mswin introduced at r39819. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: added a declaration of ruby_kill().kosaki2013-03-191-0/+23
| | | | | | | | | | | | | | | | | | | | * thread.c (ruby_kill): helper function of kill(). * signal.c (rb_f_kill): use ruby_kill() instead of kill(). * signal.c (rb_f_kill): call rb_thread_execute_interrupts() to ensure that make SignalException if sent a signal to myself. [Bug #7951] [ruby-core:52864] * vm_core.h (typedef struct rb_thread_struct): added th->interrupt_cond. * thread.c (rb_threadptr_interrupt_common): added to initialization of th->interrupt_cond. * thread.c (thread_create_core): ditto. * test/ruby/test_signal.rb (TestSignal#test_hup_me): test for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: disabled _FORTIFY_SOURCE for avoid to hit glibc bug.kosaki2013-03-161-0/+13
| | | | | | | | [Bug #8080] [ruby-core:53349] * test/ruby/test_io.rb (TestIO#test_io_select_with_many_files): test for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* prefix global symbolsnobu2013-03-061-2/+2
| | | | | | | | | | | | | | * iseq.c (rb_insn_operand_intern): prefix global symbols. * numeric.c (ruby_num_interval_step_size): ditto. * vm_backtrace.c (rb_vm_backtrace_str_ary), (rb_vm_backtrace_location_ary, rb_vm_thread_backtrace), (rb_vm_thread_backtrace_locations): ditto. * vm_trace.c (rb_vm_trace_mark_event_hooks): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: rdoc formatting for Thread, ThreadGroup, and ThreadErrorzzak2013-02-271-101/+128
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_wakeup): rdoc formattingzzak2013-02-271-3/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c (rb_thread_group): rdoc formattingzzak2013-02-271-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thread_raise_m): rdoc formattingzzak2013-02-271-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: remove unnecessary sentencenobu2013-02-251-3/+0
| | | | | | | * thread.c (thread_start): initialize method is not concerned with Thread.start and Thread.fork. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: Document Thread::new, clean up ::fork and mention callingzzak2013-02-251-4/+26
| | | | | | | super if subclassing Thread git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: Document ThreadGroup::Defaultzzak2013-02-241-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: Grammar for #backtrace_locations and ::handle_interruptzzak2013-02-241-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: Documentation for Thread#backtrace_locationszzak2013-02-231-2/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: Improved rdoc for ::handle_interrupt, ::pending_interrupt?zzak2013-02-231-38/+68
| | | | | | | and #pending_interrupt? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Thu Jan 10 19:39:05 2013 TAKANO `takano32' Mitsuhiro <tak@no32.tk>takano322013-01-101-1/+1
| | | | | | | * thread.c: fix RB_GC_SAVE_MACHINE_REGISTER_STACK define for ia64. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ChangeLog: revert a part of r38595. 'iff' means 'if and only if', not typo.usa2012-12-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c, include/ruby/intern.h (rb_big_eql): exported.usa2012-12-251-5/+12
| | | | | | | | | | * thread.c (recursive_check): object_id maybe a Bignum, not Fixnum on LLP64. see also r38493 and r38548. reported by Heesob Park at [ruby-core:51083] [Bug #7607], and patched by shirosaki at [ruby-core:51095] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add empty line for style.ko12012-12-251-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: rename methods:ko12012-12-231-120/+138
| | | | | | | | | | | | | | | | | | from Thread.async_interrupt_timing to Thread.handle_interrupt, from Thread.async_interrupted? to Thread.pending_interrupt?. Also rename option from `defer' to `never'. [ruby-core:51074] [ruby-trunk - Feature #6762] * vm_core.c, thread.c: rename functions and data structure `async_errinfo' to `pending_interrupt'. * thread.c: add global variables sym_immediate, sym_on_blocking and sym_never. * cont.c, process.c, vm.c, signal.c: ditto. * lib/sync.rb, lib/thread.rb: catch up this renaming. * test/ruby/test_thread.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: ignore result of blocking_region_beginnobu2012-12-231-1/+8
| | | | | | | | | * thread.c (BLOCKING_REGION): if fail_if_interrupted is false ignore the result of blocking_region_begin(), since it always is true in that case. suppress "uninitialized" warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (rb_fiber_start): in case of jump with TAG_FATAL,nagachika2012-12-221-2/+3
| | | | | | | | | | | | | | | | | enqueue error into async_errinfo_queue, because you cannot call TH_TAG_JUMP() in this function. [ruby-dev:45218] [Bug #5993] * thread.c (rb_threadptr_execute_interrupts): now INT2FIX(TAG_FATAL) can be popped from async_errinfo_queue. * vm.c (rb_vm_make_jump_tag_but_local_jump): revert r38441. rb_vm_make_jump_tag_but_local_jump() shouldn't return exception in case of state == TAG_FATAL. * test/ruby/test_fiber.rb (test_exit_in_fiber): fix a test to illuminate Thread.exit should terminate current Thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* style fix.kosaki2012-12-191-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_wait_fd_rw): fix infinite loop bug.kosaki2012-12-181-5/+3
| | | | | | rb_wait_for_single_fd() never return positive number. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (yycompile0): adjust indent.nobu2012-12-151-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_mutex_owned_p): remove static.kosaki2012-12-151-1/+1
| | | | | | | | | * io.c (io_flush_buffer): don't hold mutex if already have. Now recursive lock may occur when following scenario. fptr_finalize -> finish_writeconv_sync -> finish_writeconv -> io_fflush. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_thread_wait_fd_rw): remove silly rb_thread_alone()kosaki2012-12-151-1/+0
| | | | | | check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread.c: revert r38382 but deprecate rb_thread_polling()nobu2012-12-151-0/+19
| | | | | | | * thread.c (rb_thread_polling): revert but deprecate. * include/ruby/intern.h (rb_thread_polling): deprecate. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_file_flock): use rb_thread_wait_for() instead ofkosaki2012-12-141-19/+0
| | | | | | | | rb_thread_polling(). When getting EAGAIN, we need to wait a while even if no multi threading. * thread.c (sleep_for_polling, rb_thread_polling) removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e