From 7c36f3648e39ace752c67c71867693ce1eee52a3 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 10 Jun 2010 15:38:40 +0200 Subject: Now tracking the amount of concurrent writers to assure the channel is closed only when there is no one else writing to it. This assures that all tasks can continue working, and put their results accordingly. Shutdown is still not working correctly, but that should be solvable as well. Its still not perfect though ... --- test/git/async/test_pool.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/git/async/test_pool.py') diff --git a/test/git/async/test_pool.py b/test/git/async/test_pool.py index d34f6773..7cb94a86 100644 --- a/test/git/async/test_pool.py +++ b/test/git/async/test_pool.py @@ -42,7 +42,7 @@ class _TestTaskBase(object): print self.item_count, fc assert self.item_count == fc self.lock.release() - + assert self._num_writers == 0 return self @@ -381,6 +381,7 @@ class TestThreadPool(TestBase): st = time.time() items = rcs[-1].read() elapsed = time.time() - st + print len(items), ni assert len(items) == ni del(rcs) assert pool.num_tasks() == 0 # tasks depleted, all done, no handles -- cgit v1.2.1