Package _emerge :: Module AsynchronousLock :: Class AsynchronousLock
[hide private]

Class AsynchronousLock

source code

                        object --+        
portage.util.SlotObject.SlotObject --+    
     AsynchronousTask.AsynchronousTask --+

This uses the portage.locks module to acquire a lock asynchronously, using either a thread (if available) or a subprocess.

The default behavior is to use a process instead of a thread, since there is currently no way to interrupt a thread that is waiting for a lock (notably, SIGINT doesn't work because python delivers all signals to the main thread).

Instance Methods [hide private]
_start(self) source code
_imp_exit(self, imp) source code
Subclasses should implement this, as a template method to be called by AsynchronousTask.cancel().
source code
_poll(self) source code
_wait(self) source code
This method is deprecated in favor of async_unlock, since waiting for the child process to respond can trigger event loop recursion which is incompatible with asyncio.
source code
Release the lock asynchronously.
source code

Inherited from AsynchronousTask.AsynchronousTask: addExitListener, addStartListener, cancel, isAlive, poll, removeExitListener, removeStartListener, start, wait

Inherited from portage.util.SlotObject.SlotObject: __init__, copy

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  _use_process_by_default = True
Properties [hide private]

Inherited from AsynchronousTask.AsynchronousTask: background, cancelled, returncode

Inherited from object: __class__

Method Details [hide private]


source code 
Overrides: AsynchronousTask.AsynchronousTask._start


source code 

Subclasses should implement this, as a template method to be called by AsynchronousTask.cancel().

Overrides: AsynchronousTask.AsynchronousTask._cancel
(inherited documentation)


source code 
Overrides: AsynchronousTask.AsynchronousTask._poll


source code 
Overrides: AsynchronousTask.AsynchronousTask._wait


source code 

Release the lock asynchronously. Release notification is available via the add_done_callback method of the returned Future instance.

Future, result is None