[前][次][番号順一覧][スレッド一覧]

ruby-changes:32784

From: naruse <ko1@a...>
Date: Thu, 6 Feb 2014 16:24:51 +0900 (JST)
Subject: [ruby-changes:32784] naruse:r44863 (ruby_2_1): merge revision(s) 44852: [Backport #9343]

naruse	2014-02-06 16:24:46 +0900 (Thu, 06 Feb 2014)

  New Revision: 44863

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44863

  Log:
    merge revision(s) 44852: [Backport #9343]
    
    * 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

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/ext/thread/thread.c
    branches/ruby_2_1/test/thread/test_queue.rb
    branches/ruby_2_1/version.h
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 44862)
+++ ruby_2_1/ChangeLog	(revision 44863)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Thu Feb 6 08:23:28 2014  Eric Wong  <e@8...>
+
+	* 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
+
 Thu Feb  6 11:27:39 2014  Eric Hodel  <drbrain@s...>
 
 	* lib/rubygems: RubyGems 2.2.2 which contains the following bug fixes:
Index: ruby_2_1/ext/thread/thread.c
===================================================================
--- ruby_2_1/ext/thread/thread.c	(revision 44862)
+++ ruby_2_1/ext/thread/thread.c	(revision 44863)
@@ -437,7 +437,7 @@ rb_szqueue_max_set(VALUE self, VALUE vma https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/thread/thread.c#L437
 	diff = max - GET_SZQUEUE_ULONGMAX(self);
     }
     RSTRUCT_SET(self, SZQUEUE_MAX, vmax);
-    while (diff > 0 && !NIL_P(t = rb_ary_shift(GET_QUEUE_QUE(self)))) {
+    while (diff-- > 0 && !NIL_P(t = rb_ary_shift(GET_SZQUEUE_WAITERS(self)))) {
 	rb_thread_wakeup_alive(t);
     }
     return vmax;
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 44862)
+++ ruby_2_1/version.h	(revision 44863)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.1"
 #define RUBY_RELEASE_DATE "2014-02-06"
-#define RUBY_PATCHLEVEL 26
+#define RUBY_PATCHLEVEL 27
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 2
Index: ruby_2_1/test/thread/test_queue.rb
===================================================================
--- ruby_2_1/test/thread/test_queue.rb	(revision 44862)
+++ ruby_2_1/test/thread/test_queue.rb	(revision 44863)
@@ -55,6 +55,13 @@ class TestQueue < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/thread/test_queue.rb#L55
     assert_equal(1, q.max)
     assert_raise(ArgumentError) { q.max = -1 }
     assert_equal(1, q.max)
+
+    before = q.max
+    q.max.times { q << 1 }
+    t1 = Thread.new { q << 1 }
+    sleep 0.01 until t1.stop?
+    q.max = q.max + 1
+    assert_equal before + 1, q.max
   end
 
   def test_queue_pop_interrupt

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r44852


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]