Actions
Bug #1245
closedSizedQueue can be pushed over its limit
Description
=begin
遠藤です。
SizedQueue のリミットの判定が間違っています。
$ ./miniruby -rlib/thread -e 'q = SizedQueue.new(2); q << 1; q << 1; q
<< 1; p q'
#<SizedQueue:0x81f595c @max=2, @queue_wait=[], @que=[1, 1, 1],
@waiting=[], @mutex=#Mutex:0x81f590c>
次回のパッチリリースに含めるべきだと思います。
Index: lib/thread.rb¶
--- lib/thread.rb (revision 22764)
+++ lib/thread.rb (working copy)
@@ -292,7 +292,7 @@
t = nil
@mutex.synchronize{
while true
-
break if @que.length <= @max
-
break if @que.length < @max @queue_wait.push Thread.current @mutex.sleep end
--
Yusuke ENDOH [email protected]
=end
Updated by mame (Yusuke Endoh) over 16 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
Applied in changeset r22765.
=end
Actions
Like0
Like0