← back to Atmos Game
assets/gen/.venv/lib/python3.12/site-packages/httpcore/__pycache__/_synchronization.cpython-312.pyc
81 lines
�
c�bj�$ � �P � d dl mZ d dlZd dlZddlmZmZmZ d dlZ d dlZdd�Z G d� d� Z
G d� d � Z G d
� d� Z G d� d
� Z G d� d� Z G d� d� Z G d� d� Z G d� d� Z G d� d� Z G d� d� Zy# e e
f$ r dZY �yw xY w# e $ r dZY ��w xY w)� )�annotationsN� )�ExceptionMapping�PoolTimeout�map_exceptionsc �� � dd l } | j � }|dvrt d� �|dk( rt �t d� �|dk( rt
�t d� �|S # t $ r d}Y �Jw xY w)Nr �asyncio)r �trioz/Running under an unsupported async environment.zBRunning with asyncio requires installation of 'httpcore[asyncio]'.r
z<Running with trio requires installation of 'httpcore[trio]'.)�sniffio�current_async_library�ImportError�RuntimeError�anyior
)r �environments �p/Users/macstudio3/Projects/atmos-game/assets/gen/.venv/lib/python3.12/site-packages/httpcore/_synchronization.pyr r s� � �6�� �3�3�5���-�-��L�M�M��i��E�M��P�
�
� �f�����J�
�
� ���% � ��� �s �A �A!� A!c �F � e Zd ZdZdd�Zdd�Zdd�Z d d
d�Zy)� AsyncLock��
This is a standard lock.
In the sync case `Lock` provides thread locking.
In the async case `AsyncLock` provides async locking.
c � � d| _ y �N� ��_backend��selfs r �__init__zAsyncLock.__init__8 � � ���
� c �� � t � | _ | j dk( rt j � | _ y| j dk( rt j � | _ yy�z~
Detect if we're running under 'asyncio' or 'trio' and create
a lock with the correct implementation.
r
r N)r r r
�Lock�
_trio_lockr �_anyio_lockr s r �setupzAsyncLock.setup; sF � �
.�/��
��=�=�F�"�"�i�i�k�D�O�
�]�]�i�
'�$�z�z�|�D�� (r c � � K � | j s| j � | j dk( r$| j j � � d { ��� | S | j dk( r"| j j � � d { ��� | S 7 �97 ��w�Nr
r )r r$ r"