$94 GRAYBYTE WORDPRESS FILE MANAGER $52

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/alt/python35/lib64/python3.5/asyncio/__pycache__/

HOME
Current File : /opt/alt/python35/lib64/python3.5/asyncio/__pycache__//locks.cpython-35.pyc


��Yf�:�@s�dZdddddgZddlZdd	lmZdd
lmZddlmZddlmZGd
d�d�Z	Gdd�d�Z
Gdd�de
�ZGdd�d�ZGdd�de
�Z
Gdd�de
�ZGdd�de�ZdS)zSynchronization primitives.�Lock�Event�	Condition�	Semaphore�BoundedSemaphore�N�)�compat)�events)�futures)�	coroutinec@s:eZdZdZdd�Zdd�Zdd�ZdS)	�_ContextManageraContext manager.

    This enables the following idiom for acquiring and releasing a
    lock around a block:

        with (yield from lock):
            <block>

    while failing loudly when accidentally using:

        with lock:
            <block>
    cCs
||_dS)N)�_lock)�self�lock�r�2/opt/alt/python35/lib64/python3.5/asyncio/locks.py�__init__sz_ContextManager.__init__cCsdS)Nr)rrrr�	__enter__sz_ContextManager.__enter__cGs"z|jj�Wdd|_XdS)N)r
�release)r�argsrrr�__exit__$sz_ContextManager.__exit__N)�__name__�
__module__�__qualname__�__doc__rrrrrrrr
s
rc@sseZdZdd�Zdd�Zedd��Zejrodd�Z	ed	d
��Z
edd��Zd
S)�_ContextManagerMixincCstd��dS)Nz9"yield from" should be used as context manager expression)�RuntimeError)rrrrr,sz_ContextManagerMixin.__enter__cGsdS)Nr)rrrrrr0sz_ContextManagerMixin.__exit__ccs|j�EdHt|�S)N)�acquirer)rrrr�__iter__5sz_ContextManagerMixin.__iter__ccs|j�EdHt|�S)N)rr)rrrr�	__await__Hsz_ContextManagerMixin.__await__ccs|j�EdHdS)N)r)rrrr�
__aenter__Msz_ContextManagerMixin.__aenter__cCs|j�dS)N)r)r�exc_type�exc�tbrrr�	__aexit__Tsz_ContextManagerMixin.__aexit__N)rrrrrrrrZPY35rr r$rrrrr+s	rcspeZdZdZdddd�Z�fdd�Zdd	�Zed
d��Zdd
�Z	dd�Z
�S)ra�Primitive lock objects.

    A primitive lock is a synchronization primitive that is not owned
    by a particular coroutine when locked.  A primitive lock is in one
    of two states, 'locked' or 'unlocked'.

    It is created in the unlocked state.  It has two basic methods,
    acquire() and release().  When the state is unlocked, acquire()
    changes the state to locked and returns immediately.  When the
    state is locked, acquire() blocks until a call to release() in
    another coroutine changes it to unlocked, then the acquire() call
    resets it to locked and returns.  The release() method should only
    be called in the locked state; it changes the state to unlocked
    and returns immediately.  If an attempt is made to release an
    unlocked lock, a RuntimeError will be raised.

    When more than one coroutine is blocked in acquire() waiting for
    the state to turn to unlocked, only one coroutine proceeds when a
    release() call resets the state to unlocked; first coroutine which
    is blocked in acquire() is being processed.

    acquire() is a coroutine and should be called with 'yield from'.

    Locks also support the context management protocol.  '(yield from lock)'
    should be used as the context manager expression.

    Usage:

        lock = Lock()
        ...
        yield from lock
        try:
            ...
        finally:
            lock.release()

    Context manager usage:

        lock = Lock()
        ...
        with (yield from lock):
             ...

    Lock objects can be tested for locking state:

        if not lock.locked():
           yield from lock
        else:
           # lock is acquired
           ...

    �loopNcCsCtj�|_d|_|dk	r0||_ntj�|_dS)NF)�collections�deque�_waiters�_locked�_loopr	�get_event_loop)rr%rrrr�s
	z
Lock.__init__csbt�j�}|jrdnd}|jrHdj|t|j��}dj|dd�|�S)N�locked�unlockedz
{},waiters:{}z	<{} [{}]>r���)�super�__repr__r)r(�format�len)r�res�extra)�	__class__rrr0�s
	z
Lock.__repr__cCs|jS)z Return True if lock is acquired.)r))rrrrr,�szLock.lockedccs�|jr3tdd�|jD��r3d|_dS|jj�}|jj|�zLy|EdHd|_dSWn+tjk
r�|js�|j��YnXWd|jj	|�XdS)z�Acquire a lock.

        This method blocks until the lock is unlocked, then sets it to
        locked and returns True.
        css|]}|j�VqdS)N)�	cancelled)�.0�wrrr�	<genexpr>�szLock.acquire.<locals>.<genexpr>TN)
r)�allr(r*�
create_future�appendr
�CancelledError�_wake_up_first�remove)r�futrrrr�s&				
zLock.acquirecCs/|jrd|_|j�ntd��dS)aGRelease a lock.

        When the lock is locked, reset it to unlocked, and return.
        If any other coroutines are blocked waiting for the lock to become
        unlocked, allow exactly one of them to proceed.

        When invoked on an unlocked lock, a RuntimeError is raised.

        There is no return value.
        FzLock is not acquired.N)r)r>r)rrrrr�s		
zLock.releasecCs2x+|jD] }|j�s
|jd�Pq
WdS)z-Wake up the first waiter who isn't cancelled.TN)r(�done�
set_result)rr@rrrr>�s
zLock._wake_up_first)rrrrrr0r,rrrr>rr)r5rrYs4cspeZdZdZdddd�Z�fdd�Zdd	�Zd
d�Zdd
�Ze	dd��Z
�S)ra#Asynchronous equivalent to threading.Event.

    Class implementing event objects. An event manages a flag that can be set
    to true with the set() method and reset to false with the clear() method.
    The wait() method blocks until the flag is true. The flag is initially
    false.
    r%NcCsCtj�|_d|_|dk	r0||_ntj�|_dS)NF)r&r'r(�_valuer*r	r+)rr%rrrr�s
	zEvent.__init__csbt�j�}|jrdnd}|jrHdj|t|j��}dj|dd�|�S)N�setZunsetz
{},waiters:{}z	<{} [{}]>rr.)r/r0rCr(r1r2)rr3r4)r5rrr0�s
	zEvent.__repr__cCs|jS)z5Return True if and only if the internal flag is true.)rC)rrrr�is_set�szEvent.is_setcCsC|js?d|_x*|jD]}|j�s|jd�qWdS)z�Set the internal flag to true. All coroutines waiting for it to
        become true are awakened. Coroutine that call wait() once the flag is
        true will not block at all.
        TN)rCr(rArB)rr@rrrrD�s
		z	Event.setcCs
d|_dS)z�Reset the internal flag to false. Subsequently, coroutines calling
        wait() will block until set() is called to set the internal flag
        to true again.FN)rC)rrrr�clear�szEvent.clearccsU|jr
dS|jj�}|jj|�z|EdHdSWd|jj|�XdS)z�Block until the internal flag is true.

        If the internal flag is true on entry, return True
        immediately.  Otherwise, block until another coroutine calls
        set() to set the flag to true, then return True.
        TN)rCr*r;r(r<r?)rr@rrr�waits		z
Event.wait)rrrrrr0rErDrFrrGrr)r5rr�scs|eZdZdZddddd�Z�fdd�Zedd	��Zed
d��Zdd
d�Z	dd�Z
�S)raAsynchronous equivalent to threading.Condition.

    This class implements condition variable objects. A condition variable
    allows one or more coroutines to wait until they are notified by another
    coroutine.

    A new Lock object is created and used as the underlying lock.
    Nr%cCs�|dk	r||_ntj�|_|dkrHtd|j�}n|j|jk	rftd��||_|j|_|j|_|j|_t	j
�|_dS)Nr%z"loop argument must agree with lock)r*r	r+r�
ValueErrorr
r,rrr&r'r()rrr%rrrrs	zCondition.__init__cset�j�}|j�r!dnd}|jrKdj|t|j��}dj|dd�|�S)Nr,r-z
{},waiters:{}z	<{} [{}]>rr.)r/r0r,r(r1r2)rr3r4)r5rrr02s
	zCondition.__repr__ccs�|j�std��|j�zH|jj�}|jj|�z|EdHdSWd|jj|�XWdx0y|j�EdHPWqpt	j
k
r�YqpXqpWXdS)a�Wait until notified.

        If the calling coroutine has not acquired the lock when this
        method is called, a RuntimeError is raised.

        This method releases the underlying lock, and then blocks
        until it is awakened by a notify() or notify_all() call for
        the same condition variable in another coroutine.  Once
        awakened, it re-acquires the lock and returns True.
        zcannot wait on un-acquired lockNT)r,rrr*r;r(r<r?rr
r=)rr@rrrrG9s 
	zCondition.waitccs2|�}x"|s-|j�EdH|�}qW|S)z�Wait until a predicate becomes true.

        The predicate should be a callable which result will be
        interpreted as a boolean value.  The final predicate value is
        the return value.
        N)rG)rZ	predicate�resultrrr�wait_for[s
		
zCondition.wait_forrcCsf|j�std��d}xA|jD]6}||kr;P|j�s(|d7}|jd�q(WdS)aBy default, wake up one coroutine waiting on this condition, if any.
        If the calling coroutine has not acquired the lock when this method
        is called, a RuntimeError is raised.

        This method wakes up at most n of the coroutines waiting for the
        condition variable; it is a no-op if no coroutines are waiting.

        Note: an awakened coroutine does not actually return from its
        wait() call until it can reacquire the lock. Since notify() does
        not release the lock, its caller should.
        z!cannot notify on un-acquired lockrrFN)r,rr(rArB)r�n�idxr@rrr�notifyis
zCondition.notifycCs|jt|j��dS)aWake up all threads waiting on this condition. This method acts
        like notify(), but wakes up all waiting threads instead of one. If the
        calling thread has not acquired the lock when this method is called,
        a RuntimeError is raised.
        N)rMr2r()rrrr�
notify_all�szCondition.notify_all)rrrrrr0rrGrJrMrNrr)r5rrs"csseZdZdZddddd�Z�fdd�Zd	d
�Zdd�Zed
d��Z	dd�Z
�S)raA Semaphore implementation.

    A semaphore manages an internal counter which is decremented by each
    acquire() call and incremented by each release() call. The counter
    can never go below zero; when acquire() finds that it is zero, it blocks,
    waiting until some other thread calls release().

    Semaphores also support the context management protocol.

    The optional argument gives the initial value for the internal
    counter; it defaults to 1. If the value given is less than 0,
    ValueError is raised.
    rr%NcCs[|dkrtd��||_tj�|_|dk	rH||_ntj�|_dS)Nrz$Semaphore initial value must be >= 0)rHrCr&r'r(r*r	r+)r�valuer%rrrr�s	zSemaphore.__init__csqt�j�}|j�r!dndj|j�}|jrWdj|t|j��}dj|dd�|�S)Nr,zunlocked,value:{}z
{},waiters:{}z	<{} [{}]>rr.)r/r0r,r1rCr(r2)rr3r4)r5rrr0�s	zSemaphore.__repr__cCs@x9|jr;|jj�}|j�s|jd�dSqWdS)N)r(�popleftrArB)rZwaiterrrr�
_wake_up_next�s

zSemaphore._wake_up_nextcCs
|jdkS)z:Returns True if semaphore can not be acquired immediately.r)rC)rrrrr,�szSemaphore.lockedc	cs�x}|jdkr|jj�}|jj|�y
|EdHWq|j�|jdkrt|j�rt|j��YqXqW|jd8_dS)a5Acquire a semaphore.

        If the internal counter is larger than zero on entry,
        decrement it by one and return True immediately.  If it is
        zero on entry, block, waiting until some other coroutine has
        called release() to make it larger than 0, and then return
        True.
        rNrT)rCr*r;r(r<Zcancelr6rQ)rr@rrrr�s



zSemaphore.acquirecCs|jd7_|j�dS)z�Release a semaphore, incrementing the internal counter by one.
        When it was zero on entry and another coroutine is waiting for it to
        become larger than zero again, wake up that coroutine.
        rN)rCrQ)rrrrr�szSemaphore.release)rrrrrr0rQr,rrrrr)r5rr�s

csCeZdZdZddd�fdd�Z�fdd�Z�S)	rz�A bounded semaphore implementation.

    This raises ValueError in release() if it would increase the value
    above the initial value.
    rr%Ncs#||_t�j|d|�dS)Nr%)�_bound_valuer/r)rrOr%)r5rrr�s	zBoundedSemaphore.__init__cs/|j|jkrtd��t�j�dS)Nz(BoundedSemaphore released too many times)rCrRrHr/r)r)r5rrr�szBoundedSemaphore.release)rrrrrrrr)r5rr�s)r�__all__r&�rr	r
Z
coroutinesrrrrrrrrrrrr�<module>s.zBuM


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
12 Aug 2024 8.40 AM
root / linksafe
0755
__init__.cpython-35.opt-1.pyc
0.847 KB
31 May 2024 1.51 PM
root / linksafe
0644
__init__.cpython-35.opt-2.pyc
0.782 KB
31 May 2024 1.51 PM
root / linksafe
0644
__init__.cpython-35.pyc
0.847 KB
31 May 2024 1.51 PM
root / linksafe
0644
base_events.cpython-35.opt-1.pyc
40.409 KB
31 May 2024 1.51 PM
root / linksafe
0644
base_events.cpython-35.opt-2.pyc
32.986 KB
31 May 2024 1.51 PM
root / linksafe
0644
base_events.cpython-35.pyc
40.683 KB
31 May 2024 1.51 PM
root / linksafe
0644
base_subprocess.cpython-35.opt-1.pyc
9.7 KB
31 May 2024 1.51 PM
root / linksafe
0644
base_subprocess.cpython-35.opt-2.pyc
9.593 KB
31 May 2024 1.51 PM
root / linksafe
0644
base_subprocess.cpython-35.pyc
9.822 KB
31 May 2024 1.51 PM
root / linksafe
0644
compat.cpython-35.opt-1.pyc
0.775 KB
31 May 2024 1.51 PM
root / linksafe
0644
compat.cpython-35.opt-2.pyc
0.649 KB
31 May 2024 1.51 PM
root / linksafe
0644
compat.cpython-35.pyc
0.775 KB
31 May 2024 1.51 PM
root / linksafe
0644
constants.cpython-35.opt-1.pyc
0.236 KB
31 May 2024 1.51 PM
root / linksafe
0644
constants.cpython-35.opt-2.pyc
0.2 KB
31 May 2024 1.51 PM
root / linksafe
0644
constants.cpython-35.pyc
0.236 KB
31 May 2024 1.51 PM
root / linksafe
0644
coroutines.cpython-35.opt-1.pyc
8.773 KB
31 May 2024 1.51 PM
root / linksafe
0644
coroutines.cpython-35.opt-2.pyc
8.539 KB
31 May 2024 1.51 PM
root / linksafe
0644
coroutines.cpython-35.pyc
8.903 KB
31 May 2024 1.51 PM
root / linksafe
0644
events.cpython-35.opt-1.pyc
25.338 KB
31 May 2024 1.51 PM
root / linksafe
0644
events.cpython-35.opt-2.pyc
18.026 KB
31 May 2024 1.51 PM
root / linksafe
0644
events.cpython-35.pyc
25.471 KB
31 May 2024 1.51 PM
root / linksafe
0644
futures.cpython-35.opt-1.pyc
15.501 KB
31 May 2024 1.51 PM
root / linksafe
0644
futures.cpython-35.opt-2.pyc
9.518 KB
31 May 2024 1.51 PM
root / linksafe
0644
futures.cpython-35.pyc
15.778 KB
31 May 2024 1.51 PM
root / linksafe
0644
locks.cpython-35.opt-1.pyc
15.71 KB
31 May 2024 1.51 PM
root / linksafe
0644
locks.cpython-35.opt-2.pyc
9.301 KB
31 May 2024 1.51 PM
root / linksafe
0644
locks.cpython-35.pyc
15.71 KB
31 May 2024 1.51 PM
root / linksafe
0644
log.cpython-35.opt-1.pyc
0.238 KB
31 May 2024 1.51 PM
root / linksafe
0644
log.cpython-35.opt-2.pyc
0.19 KB
31 May 2024 1.51 PM
root / linksafe
0644
log.cpython-35.pyc
0.238 KB
31 May 2024 1.51 PM
root / linksafe
0644
proactor_events.cpython-35.opt-1.pyc
17.376 KB
31 May 2024 1.51 PM
root / linksafe
0644
proactor_events.cpython-35.opt-2.pyc
16.966 KB
31 May 2024 1.51 PM
root / linksafe
0644
proactor_events.cpython-35.pyc
17.616 KB
31 May 2024 1.51 PM
root / linksafe
0644
protocols.cpython-35.opt-1.pyc
5.948 KB
31 May 2024 1.51 PM
root / linksafe
0644
protocols.cpython-35.opt-2.pyc
2.262 KB
31 May 2024 1.51 PM
root / linksafe
0644
protocols.cpython-35.pyc
5.948 KB
31 May 2024 1.51 PM
root / linksafe
0644
queues.cpython-35.opt-1.pyc
8.626 KB
31 May 2024 1.51 PM
root / linksafe
0644
queues.cpython-35.opt-2.pyc
5.811 KB
31 May 2024 1.51 PM
root / linksafe
0644
queues.cpython-35.pyc
8.626 KB
31 May 2024 1.51 PM
root / linksafe
0644
selector_events.cpython-35.opt-1.pyc
31.813 KB
31 May 2024 1.51 PM
root / linksafe
0644
selector_events.cpython-35.opt-2.pyc
30.248 KB
31 May 2024 1.51 PM
root / linksafe
0644
selector_events.cpython-35.pyc
31.876 KB
31 May 2024 1.51 PM
root / linksafe
0644
sslproto.cpython-35.opt-1.pyc
20.934 KB
31 May 2024 1.51 PM
root / linksafe
0644
sslproto.cpython-35.opt-2.pyc
14.252 KB
31 May 2024 1.51 PM
root / linksafe
0644
sslproto.cpython-35.pyc
21.179 KB
31 May 2024 1.51 PM
root / linksafe
0644
streams.cpython-35.opt-1.pyc
20.083 KB
31 May 2024 1.51 PM
root / linksafe
0644
streams.cpython-35.opt-2.pyc
13.933 KB
31 May 2024 1.51 PM
root / linksafe
0644
streams.cpython-35.pyc
20.407 KB
31 May 2024 1.51 PM
root / linksafe
0644
subprocess.cpython-35.opt-1.pyc
7.305 KB
31 May 2024 1.51 PM
root / linksafe
0644
subprocess.cpython-35.opt-2.pyc
7.132 KB
31 May 2024 1.51 PM
root / linksafe
0644
subprocess.cpython-35.pyc
7.34 KB
31 May 2024 1.51 PM
root / linksafe
0644
tasks.cpython-35.opt-1.pyc
20.838 KB
31 May 2024 1.51 PM
root / linksafe
0644
tasks.cpython-35.opt-2.pyc
14.081 KB
31 May 2024 1.51 PM
root / linksafe
0644
tasks.cpython-35.pyc
21.037 KB
31 May 2024 1.51 PM
root / linksafe
0644
test_utils.cpython-35.opt-1.pyc
17.32 KB
31 May 2024 1.51 PM
root / linksafe
0644
test_utils.cpython-35.opt-2.pyc
16.039 KB
31 May 2024 1.51 PM
root / linksafe
0644
test_utils.cpython-35.pyc
17.718 KB
31 May 2024 1.51 PM
root / linksafe
0644
transports.cpython-35.opt-1.pyc
12.146 KB
31 May 2024 1.51 PM
root / linksafe
0644
transports.cpython-35.opt-2.pyc
6.639 KB
31 May 2024 1.51 PM
root / linksafe
0644
transports.cpython-35.pyc
12.181 KB
31 May 2024 1.51 PM
root / linksafe
0644
unix_events.cpython-35.opt-1.pyc
31.53 KB
31 May 2024 1.51 PM
root / linksafe
0644
unix_events.cpython-35.opt-2.pyc
27.898 KB
31 May 2024 1.51 PM
root / linksafe
0644
unix_events.cpython-35.pyc
31.935 KB
31 May 2024 1.51 PM
root / linksafe
0644
windows_events.cpython-35.opt-1.pyc
22.611 KB
31 May 2024 1.51 PM
root / linksafe
0644
windows_events.cpython-35.opt-2.pyc
21.502 KB
31 May 2024 1.51 PM
root / linksafe
0644
windows_events.cpython-35.pyc
22.611 KB
31 May 2024 1.51 PM
root / linksafe
0644
windows_utils.cpython-35.opt-1.pyc
5.657 KB
31 May 2024 1.51 PM
root / linksafe
0644
windows_utils.cpython-35.opt-2.pyc
5.072 KB
31 May 2024 1.51 PM
root / linksafe
0644
windows_utils.cpython-35.pyc
5.757 KB
31 May 2024 1.51 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF