redis-semaphore
redis-semaphore copied to clipboard
Calling unlock twice will add cause available resources to increase outside its bounds
It should do some kind of sense check to now allow available resources to be greater than that defined inside your semaphore, raising an error. Otherwise you can end up with nothing at all locking.
Silly example, but an easy mistake!
s.lock(60) do
s.unlock
end