diff --git a/lib/thread.rb b/lib/thread.rb index 09f2d58..524db69 100644 --- a/lib/thread.rb +++ b/lib/thread.rb @@ -269,6 +269,7 @@ class SizedQueue < Queue # Sets the maximum size of the queue. # def max=(max) + raise ArgumentError, "queue size must be positive" unless max > 0 diff = nil @mutex.synchronize { if max <= @max