aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2020-03-05 08:25:45 -0800
committerZac Medico <zmedico@gentoo.org>2020-03-05 08:31:04 -0800
commit62b0dc613d7d8eb099231bc4cb7303a0abdaf480 (patch)
tree22e7c592a4c73fffa4be5b8d415a3299e565218c /lib
parentScheduler: use add_done_callback (bug 711322) (diff)
downloadportage-62b0dc613d7d8eb099231bc4cb7303a0abdaf480.tar.gz
portage-62b0dc613d7d8eb099231bc4cb7303a0abdaf480.tar.bz2
portage-62b0dc613d7d8eb099231bc4cb7303a0abdaf480.zip
AsynchronousTask: schedule start listeners via call_soon (bug 711322)
Schedule start listeners via call_soon, in order to avoid callback races like the SequentialTaskQueue exit listener race that triggered bug 711322. Callbacks scheduled via call_soon are placed in a fifo queue, ensuring that they execute in an order that is unsurprising relative to other callbacks. Bug: https://bugs.gentoo.org/711322 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/_emerge/AsynchronousTask.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/_emerge/AsynchronousTask.py b/lib/_emerge/AsynchronousTask.py
index 580eef050..1b450e3b0 100644
--- a/lib/_emerge/AsynchronousTask.py
+++ b/lib/_emerge/AsynchronousTask.py
@@ -167,7 +167,7 @@ class AsynchronousTask(SlotObject):
self._start_listeners = None
for f in start_listeners:
- f(self)
+ self.scheduler.call_soon(f, self)
def addExitListener(self, f):
"""