summaryrefslogtreecommitdiff
path: root/test/thread
AgeCommit message (Collapse)Author
2018-04-30test/thread/test_cv.rb: test CV usability inside forked childnormal
* test/thread/test_cv.rb (def test_condvar_fork): new test [Bug #14725] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-27thread_sync.c: avoid reaching across stacks of dead threadsnormal
rb_ensure is insufficient cleanup for fork and we must reinitialize all waitqueues in the child process. Unfortunately this increases the footprint of ConditionVariable, Queue and SizedQueue by 8 bytes on 32-bit (16 bytes on 64-bit). [ruby-core:86316] [Bug #14634] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-04mjit_compile.c: merge initial JIT compilerk0kubun
which has been developed by Takashi Kokubun <takashikkbn@gmail> as YARV-MJIT. Many of its bugs are fixed by wanabe <s.wanabe@gmail.com>. This JIT compiler is designed to be a safe migration path to introduce JIT compiler to MRI. So this commit does not include any bytecode changes or dynamic instruction modifications, which are done in original MJIT. This commit even strips off some aggressive optimizations from YARV-MJIT, and thus it's slower than YARV-MJIT too. But it's still fairly faster than Ruby 2.5 in some benchmarks (attached below). Note that this JIT compiler passes `make test`, `make test-all`, `make test-spec` without JIT, and even with JIT. Not only it's perfectly safe with JIT disabled because it does not replace VM instructions unlike MJIT, but also with JIT enabled it stably runs Ruby applications including Rails applications. I'm expecting this version as just "initial" JIT compiler. I have many optimization ideas which are skipped for initial merging, and you may easily replace this JIT compiler with a faster one by just replacing mjit_compile.c. `mjit_compile` interface is designed for the purpose. common.mk: update dependencies for mjit_compile.c. internal.h: declare `rb_vm_insn_addr2insn` for MJIT. vm.c: exclude some definitions if `-DMJIT_HEADER` is provided to compiler. This avoids to include some functions which take a long time to compile, e.g. vm_exec_core. Some of the purpose is achieved in transform_mjit_header.rb (see `IGNORED_FUNCTIONS`) but others are manually resolved for now. Load mjit_helper.h for MJIT header. mjit_helper.h: New. This is a file used only by JIT-ed code. I'll refactor `mjit_call_cfunc` later. vm_eval.c: add some #ifdef switches to skip compiling some functions like Init_vm_eval. win32/mkexports.rb: export thread/ec functions, which are used by MJIT. include/ruby/defines.h: add MJIT_FUNC_EXPORTED macro alis to clarify that a function is exported only for MJIT. array.c: export a function used by MJIT. bignum.c: ditto. class.c: ditto. compile.c: ditto. error.c: ditto. gc.c: ditto. hash.c: ditto. iseq.c: ditto. numeric.c: ditto. object.c: ditto. proc.c: ditto. re.c: ditto. st.c: ditto. string.c: ditto. thread.c: ditto. variable.c: ditto. vm_backtrace.c: ditto. vm_insnhelper.c: ditto. vm_method.c: ditto. I would like to improve maintainability of function exports, but I believe this way is acceptable as initial merging if we clarify the new exports are for MJIT (so that we can use them as TODO list to fix) and add unit tests to detect unresolved symbols. I'll add unit tests of JIT compilations in succeeding commits. Author: Takashi Kokubun <takashikkbn@gmail.com> Contributor: wanabe <s.wanabe@gmail.com> Part of [Feature #14235] --- * Known issues * Code generated by gcc is faster than clang. The benchmark may be worse in macOS. Following benchmark result is provided by gcc w/ Linux. * Performance is decreased when Google Chrome is running * JIT can work on MinGW, but it doesn't improve performance at least in short running benchmark. * Currently it doesn't perform well with Rails. We'll try to fix this before release. --- * Benchmark reslts Benchmarked with: Intel 4.0GHz i7-4790K with 16GB memory under x86-64 Ubuntu 8 Cores - 2.0.0-p0: Ruby 2.0.0-p0 - r62186: Ruby trunk (early 2.6.0), before MJIT changes - JIT off: On this commit, but without `--jit` option - JIT on: On this commit, and with `--jit` option ** Optcarrot fps Benchmark: https://github.com/mame/optcarrot | |2.0.0-p0 |r62186 |JIT off |JIT on | |:--------|:--------|:--------|:--------|:--------| |fps |37.32 |51.46 |51.31 |58.88 | |vs 2.0.0 |1.00x |1.38x |1.37x |1.58x | ** MJIT benchmarks Benchmark: https://github.com/benchmark-driver/mjit-benchmarks (Original: https://github.com/vnmakarov/ruby/tree/rtl_mjit_branch/MJIT-benchmarks) | |2.0.0-p0 |r62186 |JIT off |JIT on | |:----------|:--------|:--------|:--------|:--------| |aread |1.00 |1.09 |1.07 |2.19 | |aref |1.00 |1.13 |1.11 |2.22 | |aset |1.00 |1.50 |1.45 |2.64 | |awrite |1.00 |1.17 |1.13 |2.20 | |call |1.00 |1.29 |1.26 |2.02 | |const2 |1.00 |1.10 |1.10 |2.19 | |const |1.00 |1.11 |1.10 |2.19 | |fannk |1.00 |1.04 |1.02 |1.00 | |fib |1.00 |1.32 |1.31 |1.84 | |ivread |1.00 |1.13 |1.12 |2.43 | |ivwrite |1.00 |1.23 |1.21 |2.40 | |mandelbrot |1.00 |1.13 |1.16 |1.28 | |meteor |1.00 |2.97 |2.92 |3.17 | |nbody |1.00 |1.17 |1.15 |1.49 | |nest-ntimes|1.00 |1.22 |1.20 |1.39 | |nest-while |1.00 |1.10 |1.10 |1.37 | |norm |1.00 |1.18 |1.16 |1.24 | |nsvb |1.00 |1.16 |1.16 |1.17 | |red-black |1.00 |1.02 |0.99 |1.12 | |sieve |1.00 |1.30 |1.28 |1.62 | |trees |1.00 |1.14 |1.13 |1.19 | |while |1.00 |1.12 |1.11 |2.41 | ** Discourse's script/bench.rb Benchmark: https://github.com/discourse/discourse/blob/v1.8.7/script/bench.rb NOTE: Rails performance was somehow a little degraded with JIT for now. We should fix this. (At least I know opt_aref is performing badly in JIT and I have an idea to fix it. Please wait for the fix.) *** JIT off Your Results: (note for timings- percentile is first, duration is second in millisecs) categories_admin: 50: 17 75: 18 90: 22 99: 29 home_admin: 50: 21 75: 21 90: 27 99: 40 topic_admin: 50: 17 75: 18 90: 22 99: 32 categories: 50: 35 75: 41 90: 43 99: 77 home: 50: 39 75: 46 90: 49 99: 95 topic: 50: 46 75: 52 90: 56 99: 101 *** JIT on Your Results: (note for timings- percentile is first, duration is second in millisecs) categories_admin: 50: 19 75: 21 90: 25 99: 33 home_admin: 50: 24 75: 26 90: 30 99: 35 topic_admin: 50: 19 75: 20 90: 25 99: 30 categories: 50: 40 75: 44 90: 48 99: 76 home: 50: 42 75: 48 90: 51 99: 89 topic: 50: 49 75: 55 90: 58 99: 99 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Fix test-all tests to avoid creating report_on_exception warningseregon
* The warnings are shown by Thread.report_on_exception defaulting to true. [Feature #14143] [ruby-core:83979] * Improves tests by narrowing down the scope where an exception is expected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-08Remove unnecessary `require 'thread'`kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-09test/thread: relax internal implementation check in error messagenormal
Queue, SizedQueue, and ConditionVariable internal implementation should not be tied to using arrays. Implementation details can change and I am working on a change to remove the dependency on arrays (as others may attempt, too) by using ccan/list for the waiter list. * test/thread/test_cv.rb (test_dump): remove check for Array * test/thread/test_queue.rb (test_dump): ditto [ruby-core:81001] [Misc #13541] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-01test_queue.rb: fix portabilitynobu
* test/thread/test_queue.rb (test_queue_with_trap): fix portability. use SIGINT instead of SIGUSR2 which is supported on not all platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-31allow Queue operation in trap.ko1
* thread_sync.c: allow spurious wakeup to check Queue status just after trap. [Bug #12405] * test/thread/test_queue.rb: add a test for it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-15Fix regexp and typokazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-14* test/thread/test_queue.rb: Give up to ten seconds for threads toheadius
reach expected state before proceeding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-10Extend timeout for RubyCI chkbuild on Debian 8.2 x86_64.shugo
On that machine, TestQueue#test_thr_kill often fails as follows: 1) Failure: TestQueue#test_thr_kill [/home/hsbt/chkbuild/tmp/build/20161109T213002Z/ruby/test/thread/test_queue.rb:155]: only 171/250 done in 30 seconds. Even if it passes, it takes about 30 seconds: [11160/16832] TestQueue#test_thr_kill = 29.80 s git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-30Use qualified namesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-13fix test of r55397naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17Use Integer instead of Fixnum and Bignum.akr
* object.c, numeric.c, enum.c, ext/-test-/bignum/mul.c, lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rexml/xpath_parser.rb, lib/rubygems/specification.rb, lib/uri/generic.rb, bootstraptest/test_eval.rb, basictest/test.rb, test/-ext-/bignum/test_big2str.rb, test/-ext-/bignum/test_div.rb, test/-ext-/bignum/test_mul.rb, test/-ext-/bignum/test_str2big.rb, test/csv/test_data_converters.rb, test/date/test_date.rb, test/json/test_json_generate.rb, test/minitest/test_minitest_mock.rb, test/openssl/test_cipher.rb, test/rexml/test_jaxen.rb, test/ruby/test_array.rb, test/ruby/test_basicinstructions.rb, test/ruby/test_bignum.rb, test/ruby/test_case.rb, test/ruby/test_class.rb, test/ruby/test_complex.rb, test/ruby/test_enum.rb, test/ruby/test_eval.rb, test/ruby/test_iseq.rb, test/ruby/test_literal.rb, test/ruby/test_math.rb, test/ruby/test_module.rb, test/ruby/test_numeric.rb, test/ruby/test_range.rb, test/ruby/test_rational.rb, test/ruby/test_refinement.rb, test/ruby/test_rubyvm.rb, test/ruby/test_struct.rb, test/ruby/test_variable.rb, test/rubygems/test_gem_specification.rb, test/thread/test_queue.rb: Use Integer instead of Fixnum and Bignum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-15Remove this test, since it won't reliably pass.headius
At the point where q.size == 0, we can't know that num_threads threads have actually finished. On e.g. JRuby, they may have called pop but not yet exited the Thread's body. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-14* bootstraptest/runner.rb: use safe navigation operator.hsbt
[fix GH-1142] Patch by @mlarraz * test/openssl/test_pair.rb: ditto. * test/ruby/test_econv.rb: ditto. * test/ruby/test_settracefunc.rb: ditto. * test/thread/test_queue.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-21* thread_sync.c: reduce the specification of Queue#close.ko1
* Queue#close accepts no arguments. * deq'ing on closed queue returns nil, always. [Feature #10600] * test/thread/test_queue.rb: catch up this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-01* test/thread/test_queue.rb: catch up last commit.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-26* thread_tools.c: add Queue#close(exception=false) andko1
SizedQueue#close(exception=false). [Feature #10600] Trying to deq from a closed empty queue return nil if exception parameter equals to false (default). If exception parameter is truthy, it raises ClosedQueueError (< StopIteration). ClosedQueueError inherits StopIteration so that you can write: loop{ e = q.deq; (using e) } Trying to close a closed queue raises ClosedQueueError. Blocking threads to wait deq for Queue and SizedQueue will be restarted immediately by returning nil (exception=false) or raising a ClosedQueueError (exception=true). Blocking threads to wait enq for SizedQueue will be restarted by raising a ClosedQueueError immediately. The above specification is not proposed specification, so that we need to continue discussion to conclude specification this method. * test/thread/test_queue.rb: add tests originally written by John Anderson and modify detailed behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-13use Timeout.timeoutnobu
* time: Object#timeout has been deprecated a long time ago, use Timeout.timeout. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-13* test/lib/envutil.rb: Moved from test/ruby/.akr
* test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-07normalize reference to Timeout::Errornormal
From: John Bachir <j@jjb.cc> * bootstraptest/test_io.rb (assert_finish): normalize rescue for Timeout::Error * lib/net/ftp.rb (Net#read_timeout): ditto for doc * lib/resolv.rb (Resolv::ResolvTimeout): ditto for subclass * lib/webrick/httprequest.rb (_read_data): ditto for rescue * sample/timeout.rb (p timeout): ditto for call * test/drb/drbtest.rb (test_06_timeout): ditto * test/ruby/test_readpartial.rb (test_open_pipe): ditto * test/thread/test_queue.rb (test_queue_thread_raise): ditto * thread.c (rb_thread_s_handle_interrupt): ditto for doc [ruby-core:65481] [misc #10339] TimeoutError is a legacy constant, Timeout::Error is the canonical constant. This patch normalizes all code and comments to reference Timeout::Error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-19thread.c: check initializednobu
* ext/thread/thread.c (get_array): check instance variables are initialized properly. [ruby-core:63826][Bug #10062] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-17thread/thread.c: non-blocking push on SizedQueuenobu
* ext/thread/thread.c (rb_szqueue_push): add optional parameter, non_block defaulted to false. [ruby-core:63794] [Feature #10052] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-17test_queue.rb: non-blocking pop testsnobu
* test/thread/test_queue.rb (test_queue_pop_non_block): test for non-blocking pop. * test/thread/test_queue.rb (test_sized_queue_pop_non_block): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-01add timeoutnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-26test/thread: fix leaked threadsnobu
* test/thread/test_{queue,sync}.rb: join work threads not to leak threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-26marshal.c: undumpable hidden objectsnobu
* marshal.c (w_object): internal objects are not dumpable. [ruby-core:61677] [Bug #9674] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-26thread.c: undumpablenobu
* ext/thread/thread.c (undumpable): ConditionVariable and Queue are not dumpable. [ruby-core:61677] [Bug #9674] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05ext/thread: SizedQueue#max= wakes up waiters properlynormal
* ext/thread/thread.c (rb_szqueue_max_set): use correct queue and limit wakeups. [Bug #9343][ruby-core:60517] * test/thread/test_queue.rb (test_sized_queue_assign_max): test for bug git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-22thread/thread.c: no dupnobu
* ext/thread/thread.c (Init_thread): ConditionVariable and Queue are not able to copy. [ruby-core:59961] [Bug #9440] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-14* ext/thread/thread.c (rb_szqueue_clear): notify SZQUEUE_WAITERSglass
on SizedQueue#clear. [ruby-core:59462] [Bug #9342] * test/thread/test_queue.rb: add test. the patch is from Justin Collins. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13* ext/thread/thread.c (rb_szqueue_push): check GET_SZQUEUE_WAITERScharliesome
instead of GET_QUEUE_WAITERS to prevent deadlock. Patch by Eric Wong. [Bug #9302] [ruby-core:59324] * test/thread/test_queue.rb: add test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-07* variable.c (classname): the name of class that hasktsj
non class id should not be nil. This bug was introduced in r36577. * test/thread/test_cv.rb: test for change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-06* common.mk: use RUNRUBY instead of MINIRUBY because MINIRUBY can'tglass
require extension libraries. The patch is from nobu (Nobuyoshi Nakada). * ext/thread/extconf.rb: for build ext/thread/thread.c. * include/ruby/intern.h: ditto. * thread.c: ditto. * lib/thread.rb: removed and replaced by ext/thread/thread.c. * ext/thread/thread.c: Queue, SizedQueue and ConditionVariable implementations in C. This patch is based on patches from panaggio (Ricardo Panaggio) and funny_falcon (Yura Sokolov) and ko1 (Koichi Sasada). [ruby-core:31513] [Feature #3620] * test/thread/test_queue.rb (test_queue_thread_raise): add a test for ensuring that killed thread should be removed from waiting threads. It is based on a code by ko1 (Koichi Sasada). [ruby-core:45950] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-11* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-10* lib/thread.rb (Queue#push): return self.kosaki
* lib/thread.rb (Queue#clear): ditto. * lib/thread.rb (SizedQueue#push): ditto. * test/thread/test_queue.rb: add tests for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-10* test/thread/test_queue.rb (TestQueue#test_thr_kill): reducekosaki
iterations from 2000 to 250. When running on uniprocessor systems, every th.kill needs TIME_QUANTUM_USEC time (i.e. 100msec on posix systems). Because, "r.read 1" is 3 steps operations that 1) release GVL 2) read 3) acquire gvl and (1) invoke context switch to main thread. and then, main thread's th.kill resume (1), but not (2). Thus read interrupt need TIME_QUANTUM_USEC. Then maximum iteration is 30sec/100msec = 300. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01* test/ruby/test_thread.rb: move ConditionVariable related testkosaki
into test/thread/test_cv.rb. * test/thread/test_cv.rb: new file. * test/thread/test_cv.rb (test_condvar_empty_signal): new tests. * test/thread/test_cv.rb (test_condvar_empty_broadcast): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01* lib/thread.rb (ConditionVariable): use hash instead of array forkosaki
@waiters. * test/thread/test_queue.rb (test_sized_queue_and_wakeup): remove a test because @waiters no longer have a chance to duplicated. Now it's a hash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30* lib/thread.rb (SizedQueue#pop): rewrite by using ConditionVariable.kosaki
* lib/thread.rb (SizedQueue#push): ditto. * lib/thread.rb (SizedQueue#max): ditto. * lib/thread.rb (Queue#pop): ditto. * lib/thread.rb (Queue#push): ditto. * lib/thread.rb (SizedQueue#num_waiting): adopt the above changes. * lib/thread.rb (SizedQueue#initialize): ditto. * lib/thread.rb (Queue#num_waiting): ditto. * lib/thread.rb (Queue#initialize): ditto. * test/thread/test_queue.rb (test_sized_queue_and_wakeup): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-29envutil.rb: kill child process when timeoutshirosaki
* test/ruby/envutil.rb (EnvUtil#invoke_ruby): kill child process before Timeout::Error is raised. rmdir of mktmpdir fails with EACCES if child process is alive on Windows. * test/thread/test_queue.rb (TestQueue): increase timeout. This test takes long time on Windows XP. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-09* lib/thread.rb (Queue#pop): Fixed double registration issue whenkosaki
mutex.sleep is interrupted. [Bug #5258] [ruby-dev:44448] * lib/thread.rb (SizedQueue#push): ditto. * test/thread/test_queue.rb (test_sized_queue_and_wakeup, test_queue_pop_interrupt, test_sized_queue_pop_interrupt, test_sized_queue_push_interrupt): new tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-09* lib/sync.rb (Sync_m#sync_lock): Fixed wakeup/raise unsafe code.kosaki
Patched by Masaki Matsushita. [Bug #5355] [ruby-dev:44521] * test/thread/test_sync.rb (test_sync_lock_and_wakeup, test_sync_upgrade_and_wakeup, test_sync_lock_and_raise): new test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-23refine message for test_thr_kill.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-23* test/thread/test_queue.rb (test_thr_kill): show the number of loopakr
run when the test failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-22Decrease timeout limit.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-18* test/thread/test_queue.rb (test_thr_kill): extend timeout.nagachika
this test takes a long time at slow machine. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-14The test added in r34034 needs to run thousands of times.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e