diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-06-06 18:13:21 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-06-06 18:13:21 +0200 |
commit | b3cde0ee162b8f0cb67da981311c8f9c16050a62 (patch) | |
tree | 537615b8d7cfd059b2d7938a1929d9e3199fb374 /lib/git/async/thread.py | |
parent | ec28ad575ce1d7bb6a616ffc404f32bbb1af67b2 (diff) | |
download | gitpython-b3cde0ee162b8f0cb67da981311c8f9c16050a62.tar.gz |
First step of testing the pool - tasks have been separated into a new module including own tests, their design improved to prepare them for some specifics that would be needed for multiprocessing support
Diffstat (limited to 'lib/git/async/thread.py')
-rw-r--r-- | lib/git/async/thread.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/git/async/thread.py b/lib/git/async/thread.py index 7ca93c86..82acbd8f 100644 --- a/lib/git/async/thread.py +++ b/lib/git/async/thread.py @@ -139,10 +139,15 @@ class WorkerThread(TerminatableThread): if self._should_terminate(): break # END check for stop request - routine = self.__class__.quit + routine = None args = tuple() kwargs = dict() - tasktuple = self.inq.get() + # don't wait too long, instead check for the termination request more often + try: + tasktuple = self.inq.get(True, 1) + except Queue.Empty: + continue + # END get task with timeout if isinstance(tasktuple, (tuple, list)): if len(tasktuple) == 3: |