summaryrefslogtreecommitdiff
path: root/lib/git/async/util.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-06-11 11:52:01 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-06-11 11:52:01 +0200
commit6d1212e8c412b0b4802bc1080d38d54907db879d (patch)
tree09025a39d44fa2a28a6533a0f969316652f974bc /lib/git/async/util.py
parentfbe062bf6dacd3ad63dd827d898337fa542931ac (diff)
downloadgitpython-6d1212e8c412b0b4802bc1080d38d54907db879d.tar.gz
IMPORTANT: sometimes, when notifying waiters by releasing their lock, the lock is not actually released or they are not actually notifyied, staying in a beautysleep. This glitch is probably caused by some detail not treated correctly in the thread python module, which is something we cannot fix. It works most of the time as expected though - maybe some cleanup is not done correctly which causes this
Diffstat (limited to 'lib/git/async/util.py')
-rw-r--r--lib/git/async/util.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/git/async/util.py b/lib/git/async/util.py
index b7750b0b..11ab75a6 100644
--- a/lib/git/async/util.py
+++ b/lib/git/async/util.py
@@ -101,10 +101,12 @@ class HSCondition(deque):
waiter.acquire() # get it the first time, no blocking
self.append(waiter)
- # in the momemnt we release our lock, someone else might actually resume
- self._lock.release()
- try: # restore state no matter what (e.g., KeyboardInterrupt)
+
+ try:
+ # restore state no matter what (e.g., KeyboardInterrupt)
# now we block, as we hold the lock already
+ # in the momemnt we release our lock, someone else might actually resume
+ self._lock.release()
if timeout is None:
waiter.acquire()
else: