We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fa3f05 commit 3e9116bCopy full SHA for 3e9116b
lib/concurrent/atomic/semaphore.rb
@@ -210,7 +210,7 @@ def reduce_permits(reduction)
210
unless reduction.is_a?(Fixnum) && reduction >= 0
211
fail ArgumentError, 'reduction must be an non-negative integer'
212
end
213
- unless @free - reduction >= 0
+ unless @semaphore.available_permits - reduction >= 0
214
fail(ArgumentError,
215
'cannot reduce number of available_permits below zero')
216
0 commit comments