summaryrefslogtreecommitdiff
path: root/lib/thread.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/thread.rb')
-rw-r--r--lib/thread.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/thread.rb b/lib/thread.rb
index 09f2d58ecc..524db69a18 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