Project

General

Profile

Bug #9342 » 0002-Wake-waiting-threads-when-SizedQueue-clear-is-called-2.0.patch

patch for Ruby 2.0.0 - jsc (Justin Collins), 01/02/2014 03:53 PM

View differences:

lib/thread.rb
alias deq pop
#
# Removes all objects from the queue and wakes waiting threads, if any.
#
def clear
@mutex.synchronize do
@que.clear
@enque_cond.signal
end
end
#
# Returns the number of threads waiting on the queue.
#
def num_waiting
(2-2/2)