Actions
Bug #9342
closed[PATCH] SizedQueue#clear does not notify waiting threads in Ruby 1.9.3
Description
In Ruby 1.9.3, when SizedQueue#clear is called, it empties the queue but does not notify waiting threads that the queue is empty. This typically leads to deadlock when the queue is full.
For example:
sq = SizedQueue.new(1)
sq << 1 # Fill queue
t1 = Thread.new do
sq << 1 # Attempt to add another item to queue, fail and go to sleep waiting
end
t2 = Thread.new do
Thread.pass
sq.clear
end
t2.join # Empty queue
t1.join # Deadlock, t1 continues to sleep
Files
Actions
Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0