summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-06 07:24:46 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-06 07:24:46 +0000
commit0de6eef3d2551974f9f48af0298d3c415c4e7727 (patch)
tree45b4329b6b3106c8cc0719fb24ba2edabc82ebfd /ext
parent9b9d3bac4d5fb0d0287b898885a2e6f1125f807c (diff)
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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@44863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-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 208d1172df..a8f675c55b 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;