pop(*args)
public
Retrieves data from the queue and runs a waiting thread, if any.
Show source
def pop(*args)
retval = super
t = nil
@mutex.synchronize {
if @que.length < @max
begin
t = @queue_wait.shift
t.wakeup if t
rescue ThreadError
retry
end
end
}
begin
t.run if t
rescue ThreadError
end
retval
end