diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-05 23:35:06 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-02-05 23:35:06 +0000 |
commit | 2d603f9feecabd7be00ed0ae4166d987c6a046e4 (patch) | |
tree | eb832bd485dc2188f948e4f23d16901697e07bc6 /ext/thread | |
parent | b9a4cf2aca343d8d9cd370775af927cd750a17b2 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/thread/thread.c b/ext/thread/thread.c index befea9ae30..cec8a5b4fa 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; |