builder,jwack: slight cleanup to token passing.
In rare cases, one process could end up holding onto more than one token.
This commit is contained in:
parent
9b800ca29f
commit
7aa7c41e38
3 changed files with 28 additions and 8 deletions
6
state.py
6
state.py
|
|
@ -162,6 +162,12 @@ class Lock:
|
|||
else:
|
||||
raise
|
||||
|
||||
def waitlock(self):
|
||||
while not self.owned:
|
||||
self.wait()
|
||||
self.trylock()
|
||||
assert(self.owned)
|
||||
|
||||
def unlock(self):
|
||||
if not self.owned:
|
||||
raise Exception("can't unlock %r - we don't own it"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue