commit:     123aee71d3e15c2b8b2d354902d83a8f8596fbeb
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 04:01:46 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 04:01:46 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=123aee71

_LockThread._run_lock: asyncio compat (bug 653856)

Use call_soon_threadsafe for asyncio compatibility.

Bug: https://bugs.gentoo.org/653856

 pym/_emerge/AsynchronousLock.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py
index 5cdfd98f6..2019adaab 100644
--- a/pym/_emerge/AsynchronousLock.py
+++ b/pym/_emerge/AsynchronousLock.py
@@ -140,13 +140,12 @@ class _LockThread(AbstractPollTask):
        def _run_lock(self):
                self._lock_obj = lockfile(self.path, wantnewlockfile=True)
                # Thread-safe callback to EventLoop
-               self.scheduler.idle_add(self._run_lock_cb)
+               self.scheduler.call_soon_threadsafe(self._run_lock_cb)
 
        def _run_lock_cb(self):
                self._unregister()
                self.returncode = os.EX_OK
                self._async_wait()
-               return False
 
        def _cancel(self):
                # There's currently no way to force thread termination.

Reply via email to