1 |
commit: 62b0dc613d7d8eb099231bc4cb7303a0abdaf480 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Mar 5 16:25:45 2020 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Mar 5 16:31:04 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=62b0dc61 |
7 |
|
8 |
AsynchronousTask: schedule start listeners via call_soon (bug 711322) |
9 |
|
10 |
Schedule start listeners via call_soon, in order to avoid callback races |
11 |
like the SequentialTaskQueue exit listener race that triggered bug |
12 |
711322. Callbacks scheduled via call_soon are placed in a fifo queue, |
13 |
ensuring that they execute in an order that is unsurprising relative to |
14 |
other callbacks. |
15 |
|
16 |
Bug: https://bugs.gentoo.org/711322 |
17 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
18 |
|
19 |
lib/_emerge/AsynchronousTask.py | 2 +- |
20 |
1 file changed, 1 insertion(+), 1 deletion(-) |
21 |
|
22 |
diff --git a/lib/_emerge/AsynchronousTask.py b/lib/_emerge/AsynchronousTask.py |
23 |
index 580eef050..1b450e3b0 100644 |
24 |
--- a/lib/_emerge/AsynchronousTask.py |
25 |
+++ b/lib/_emerge/AsynchronousTask.py |
26 |
@@ -167,7 +167,7 @@ class AsynchronousTask(SlotObject): |
27 |
self._start_listeners = None |
28 |
|
29 |
for f in start_listeners: |
30 |
- f(self) |
31 |
+ self.scheduler.call_soon(f, self) |
32 |
|
33 |
def addExitListener(self, f): |
34 |
""" |