dv/redis-semaphore

Calling unlock twice will add cause available resources to increase outside its bounds

mikebaldry opened this issue · 0 comments

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