aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'pym/_emerge/AsynchronousTask.py')
-rw-r--r--pym/_emerge/AsynchronousTask.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pym/_emerge/AsynchronousTask.py b/pym/_emerge/AsynchronousTask.py
index 4aa598085..d57ccab2b 100644
--- a/pym/_emerge/AsynchronousTask.py
+++ b/pym/_emerge/AsynchronousTask.py
@@ -129,7 +129,11 @@ class AsynchronousTask(SlotObject):
self._exit_listener_stack = self._exit_listeners
self._exit_listeners = None
- self._exit_listener_stack.reverse()
+ # Execute exit listeners in reverse order, so that
+ # the last added listener is executed first. This
+ # allows SequentialTaskQueue to decrement its running
+ # task count as soon as one of its tasks exits, so that
+ # the value is accurate when other listeners execute.
while self._exit_listener_stack:
self._exit_listener_stack.pop()(self)