1 |
commit: 123aee71d3e15c2b8b2d354902d83a8f8596fbeb |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 29 04:01:46 2018 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 29 04:01:46 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=123aee71 |
7 |
|
8 |
_LockThread._run_lock: asyncio compat (bug 653856) |
9 |
|
10 |
Use call_soon_threadsafe for asyncio compatibility. |
11 |
|
12 |
Bug: https://bugs.gentoo.org/653856 |
13 |
|
14 |
pym/_emerge/AsynchronousLock.py | 3 +-- |
15 |
1 file changed, 1 insertion(+), 2 deletions(-) |
16 |
|
17 |
diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py |
18 |
index 5cdfd98f6..2019adaab 100644 |
19 |
--- a/pym/_emerge/AsynchronousLock.py |
20 |
+++ b/pym/_emerge/AsynchronousLock.py |
21 |
@@ -140,13 +140,12 @@ class _LockThread(AbstractPollTask): |
22 |
def _run_lock(self): |
23 |
self._lock_obj = lockfile(self.path, wantnewlockfile=True) |
24 |
# Thread-safe callback to EventLoop |
25 |
- self.scheduler.idle_add(self._run_lock_cb) |
26 |
+ self.scheduler.call_soon_threadsafe(self._run_lock_cb) |
27 |
|
28 |
def _run_lock_cb(self): |
29 |
self._unregister() |
30 |
self.returncode = os.EX_OK |
31 |
self._async_wait() |
32 |
- return False |
33 |
|
34 |
def _cancel(self): |
35 |
# There's currently no way to force thread termination. |