summaryrefslogtreecommitdiff
path: root/lib/git/async/util.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-06-10 00:24:49 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-06-10 00:24:49 +0200
commit3323464f85b986cba23176271da92a478b33ab9c (patch)
tree1633f83f6c5fd5a98396fc925b44602282cbd15a /lib/git/async/util.py
parent257a8a9441fca9a9bc384f673ba86ef5c3f1715d (diff)
downloadgitpython-3323464f85b986cba23176271da92a478b33ab9c.tar.gz
messy first version of a properly working depth-first graph method, which allows the pool to work as expected. Many more tests need to be added, and there still is a problem with shutdown as sometimes it won't kill all threads, mainly because the process came up with worker threads started, which cannot be
Diffstat (limited to 'lib/git/async/util.py')
-rw-r--r--lib/git/async/util.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/git/async/util.py b/lib/git/async/util.py
index 00d0dbab..b7750b0b 100644
--- a/lib/git/async/util.py
+++ b/lib/git/async/util.py
@@ -206,7 +206,6 @@ class AsyncQueue(deque):
return old
finally:
self.mutex.release()
-
# if we won't receive anymore items, inform the getters
if not state:
self.not_empty.notify_all()
@@ -222,6 +221,13 @@ class AsyncQueue(deque):
def put(self, item, block=True, timeout=None):
self.mutex.acquire()
+ # NOTE: we explicitly do NOT check for our writable state
+ # Its just used as a notification signal, and we need to be able
+ # to continue writing to prevent threads ( easily ) from failing
+ # to write their computed results, which we want in fact
+ # NO: we want them to fail and stop processing, as the one who caused
+ # the channel to close had a reason and wants the threads to
+ # stop on the task as soon as possible
if not self._writable:
self.mutex.release()
raise ReadOnly