B
XZ @ s d Z dZddlZddlZddlmZ ddlmZ ddlmZ G dd d Z G d
d dZ
G dd
d
e
ZG dd dZG dd de
Z
G dd de
ZG dd deZdS )zSynchronization primitives.)LockEvent Condition SemaphoreBoundedSemaphore N )events)futures) coroutinec @ s( e Zd ZdZdd Zdd Zdd ZdS ) _ContextManagera\ Context manager.
This enables the following idiom for acquiring and releasing a
lock around a block:
with (yield from lock):
while failing loudly when accidentally using:
with lock:
Deprecated, use 'async with' statement:
async with lock:
c C s
|| _ d S )N)_lock)selflock r 2/opt/alt/python37/lib64/python3.7/asyncio/locks.py__init__ s z_ContextManager.__init__c C s d S )Nr )r
r r r __enter__# s z_ContextManager.__enter__c G s z| j W d d | _ X d S )N)r release)r
argsr r r __exit__( s z_ContextManager.__exit__N)__name__
__module____qualname____doc__r r r r r r r r
s r c @ sH e Zd Zdd Zdd Zedd Zdd Zd d
Zdd Z d
d Z
dS )_ContextManagerMixinc C s t dd S )Nz9"yield from" should be used as context manager expression)RuntimeError)r
r r r r 0 s z_ContextManagerMixin.__enter__c G s d S )Nr )r
r r r r r 4 s z_ContextManagerMixin.__exit__c c s&