Commit 200a63c1 authored by Julien Muchembled's avatar Julien Muchembled

Make verbose locks work in 'with' statements

parent d9471e2e
......@@ -100,11 +100,16 @@ class VerboseLockBase(object):
self._note('[%r]%s.acquire(%s) Lock granted. Waiting: %r',
me, self, blocking, self.waiting)
__enter__ = acquire
def release(self):
me = LockUser()
self._note('[%r]%s.release() Waiting: %r', me, self, self.waiting)
return self.lock.release()
def __exit__(self, t, v, tb):
self.release()
def _locked(self):
raise NotImplementedError
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment