From 0eab3143c1aad2addd0f88cfd7a62940d064df3a Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 17 Mar 2011 13:08:35 -0700 Subject: AsynchronousLock: implement _cancel --- pym/_emerge/AsynchronousLock.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pym/_emerge') diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py index 6e0a1ac2a..6fa2bf632 100644 --- a/pym/_emerge/AsynchronousLock.py +++ b/pym/_emerge/AsynchronousLock.py @@ -66,6 +66,10 @@ class AsynchronousLock(AsynchronousTask): if not self._waiting: self.wait() + def _cancel(self): + if self._imp is not None: + self._imp.cancel() + def _wait(self): if self.returncode is not None: return self.returncode @@ -127,6 +131,10 @@ class _LockThread(AbstractPollTask): self.returncode = os.EX_OK self.wait() + def _cancel(self): + # There's currently no way to force thread termination. + pass + def _wait(self): if self.returncode is not None: return self.returncode -- cgit v1.2.3-1-g7c22