python-zk/kazoo — pull request #214 by vishvananda (2014-06-11 23:36:31+00:00)
Title: Make sure Semaphore uses get_lease inside of lock

In non-blocking mode it was possible for the semaphore to acquire
the lease without being inside a lock, so mor than max_leases couild
acquire the semaphore simultaneously. This fixes the issue by ensuring
that _get_lease is always called inside the lock.