redis-semaphore icon indicating copy to clipboard operation
redis-semaphore copied to clipboard

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

Open mikebaldry opened this issue 7 years ago • 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

mikebaldry avatar Sep 15 '16 13:09 mikebaldry