summaryrefslogtreecommitdiff
path: root/ext/thread
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-05 23:35:06 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-05 23:35:06 +0000
commit2d603f9feecabd7be00ed0ae4166d987c6a046e4 (patch)
treeeb832bd485dc2188f948e4f23d16901697e07bc6 /ext/thread
parentb9a4cf2aca343d8d9cd370775af927cd750a17b2 (diff)
ext/thread: SizedQueue#max= wakes up waiters properly
* 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
Diffstat (limited to 'ext/thread')
-rw-r--r--ext/thread/thread.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/thread/thread.c b/ext/thread/thread.c
index befea9ae307..cec8a5b4fa6 100644
--- a/ext/thread/thread.c
+++ b/ext/thread/thread.c
@@ -437,7 +437,7 @@ rb_szqueue_max_set(VALUE self, VALUE vmax)
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;