HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/twisted/python/__pycache__/threadable.cpython-310.pyc
o

�b��@s�dZddlmZGdd�d�Zdd�Zde_dd	�Zd
d�Zdd
�Zdd�Z	ddd�Z
e�Zdd�Z
dd�Zdd�ZdadadadazddlZWneySdZYnweZe
d�gd�ZdS)zT
A module to provide some very basic threading primitives, such as
synchronization.
���wrapsc@seZdZdZdd�ZdS)�	DummyLockzF
    Hack to allow locks to be unpickled on an unthreaded system.
    cC�tdfS�N���
unpickle_lock��selfrr�;/usr/lib/python3/dist-packages/twisted/python/threadable.py�
__reduce__�zDummyLock.__reduce__N)�__name__�
__module__�__qualname__�__doc__r
rrrrrsrcCstdurt�St�S�N)�threadingmodule�XLockrrrrrr	sr	TcCs>d|jvrt��d|jvrt�|jd<t��|j��dS)N�_threadable_lock)�__dict__�_synchLockCreator�acquirer�releaserr
rrr�	_synchPre!s

rcCs|j��dSr)rrr
rrr�
_synchPost*srcst���fdd��}|S)Ncs4t|�z�|g|�Ri|��Wt|�St|�wr)rr)r�args�kwargs��functionrr�sync/sz_sync.<locals>.syncr)�klassr r!rrr�_sync.sr#cGsBtdur|D]}|jD]}t||j|�}t|||�qqdSdS)a&
    Make all methods listed in each class' synchronized attribute synchronized.

    The synchronized attribute should be a list of strings, consisting of the
    names of methods that must be synchronized. If we are running in threaded
    mode these methods will be wrapped with a lock.
    N)r�synchronizedr#r�setattr)�klassesr"�
methodNamer!rrr�synchronize:s
��r(�cCsN|rtstdurdaGdd�dtj�at�adStd��dStr$td��	dS)zbInitialize threading.

    Don't bother calling this.  If it needs to happen, it will happen.
    NTc@seZdZdd�ZdS)rcSrrrr
rrrr
VrzXLock.__reduce__N)rrrr
rrrrrUsrz:Cannot initialize threading, platform lacks thread supportzCannot uninitialize threads)�threadedr�_RLockrr�RuntimeError)�with_threadsrrr�initIs
��r.cCstdurtSt��jSr)r�_dummyID�current_thread�identrrrr�getThreadIDhs
r2cCs
tt�kS)zCAre we in the thread responsible for I/O requests (the event loop)?)�ioThreadr2rrrr�isInIOThreadns
r4cCs
t�adS)z8Mark the current thread as responsible for I/O requests.N)r2r3rrrr�registerAsIOThreadss
r5NF)r4r5r2r)r))r�	functoolsrrr	�__safe_for_unpickling__rrr#r(r.�objectr/r2r4r5r3r*rr�	threading�_threadingmodule�ImportErrorr�__all__rrrr�<module>s4		
�