From bb79c011bf39cab7bcf82656548b04c80db7347f Mon Sep 17 00:00:00 2001 From: kosaki Date: Tue, 15 Sep 2015 19:23:43 +0000 Subject: * test/ruby/test_thread.rb (TestThread#test_mutex_synchronize): insert waste loop for invoking preemptive thread context switch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ test/ruby/test_thread.rb | 19 +++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3c6b4afd7d..67b7f59091 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Sep 16 03:49:19 2015 KOSAKI Motohiro + + * test/ruby/test_thread.rb (TestThread#test_mutex_synchronize): + insert waste loop for invoking preemptive thread context switch. + [Bug #11496] + Tue Sep 15 19:38:55 2015 Nobuyoshi Nakada * gc.c (rb_objspace_alloc, rb_objspace_free): define always diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index be8a28a14b..fe8e2384a0 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -97,21 +97,24 @@ class TestThread < Test::Unit::TestCase def test_mutex_synchronize m = Mutex.new r = 0 - max = 10 - (1..max).map{ + num_threads = 10 + loop=100 + (1..num_threads).map{ Thread.new{ - i=0 - while i