pvalena / rpms / ruby

Forked from rpms/ruby 6 years ago
Clone
8f31ccc
Index: ChangeLog
8f31ccc
===================================================================
8f31ccc
--- ChangeLog	(revision 39727)
8f31ccc
+++ ChangeLog	(revision 39728)
8f31ccc
@@ -1,3 +1,15 @@
8f31ccc
+Tue Mar 12 00:56:19 2013  KOSAKI Motohiro  <kosaki.motohiro@gmail.com>
8f31ccc
+
8f31ccc
+	* test/thread/test_queue.rb (TestQueue#test_thr_kill): reduce
8f31ccc
+	  iterations from 2000 to 250. When running on uniprocessor
8f31ccc
+	  systems, every th.kill needs TIME_QUANTUM_USEC time (i.e.
8f31ccc
+	  100msec on posix systems). Because, "r.read 1" is 3 steps
8f31ccc
+	  operations that 1) release GVL 2) read 3) acquire gvl and
8f31ccc
+	  (1) invoke context switch to main thread. and then, main
8f31ccc
+	  thread's th.kill resume (1), but not (2). Thus read interrupt
8f31ccc
+	  need TIME_QUANTUM_USEC. Then maximum iteration is 30sec/100msec
8f31ccc
+	  = 300.
8f31ccc
+
8f31ccc
 Sun Feb 24 15:16:00 2013  Eric Hodel  <drbrain@segment7.net>
8f31ccc
 
8f31ccc
 	* lib/net/http.rb:  Removed duplicate Accept-Encoding in Net::HTTP#get.
8f31ccc
Index: test/thread/test_queue.rb
8f31ccc
===================================================================
8f31ccc
--- test/thread/test_queue.rb	(revision 39727)
8f31ccc
+++ test/thread/test_queue.rb	(revision 39728)
8f31ccc
@@ -85,7 +85,7 @@
8f31ccc
     bug5343 = '[ruby-core:39634]'
8f31ccc
     Dir.mktmpdir {|d|
8f31ccc
       timeout = 30
8f31ccc
-      total_count = 2000
8f31ccc
+      total_count = 250
8f31ccc
       begin
8f31ccc
         assert_normal_exit(<<-"_eom", bug5343, {:timeout => timeout, :chdir=>d})
8f31ccc
           require "thread"
8f31ccc
@@ -98,7 +98,8 @@
8f31ccc
               r.read 1
8f31ccc
             }
8f31ccc
             queue.pop
8f31ccc
-            th.kill.join
8f31ccc
+            th.kill
8f31ccc
+            th.join
8f31ccc
           end
8f31ccc
         _eom
8f31ccc
       rescue Timeout::Error
8f31ccc
8f31ccc
Property changes on: .
8f31ccc
___________________________________________________________________
8f31ccc
Modified: svn:mergeinfo
8f31ccc
   Merged /trunk:r39688
8f31ccc