mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 17:14:01 +02:00
merge revision(s) 44595: [Backport #9342]
* ext/thread/thread.c (rb_szqueue_clear): notify SZQUEUE_WAITERS on SizedQueue#clear. [ruby-core:59462] [Bug #9342] * test/thread/test_queue.rb: add test. the patch is from Justin Collins. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@44899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f0e5252835
commit
08e1428b7b
4 changed files with 88 additions and 1 deletions
|
@ -318,6 +318,18 @@ class SizedQueue < Queue
|
|||
end
|
||||
end
|
||||
|
||||
#
|
||||
# Removes all objects from the queue.
|
||||
#
|
||||
def clear
|
||||
super
|
||||
@mutex.synchronize do
|
||||
@max.times do
|
||||
@enque_cond.signal
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# Alias of push
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue