
    nh
                       U d Z ddlmZ ddlZddlZddlZddlZddlZddlmZ ddl	m
Z
mZmZ ddlZ eed      Z ej"                         Zded<    ed	      Zej*                  d
k\  rej,                  Zej.                  Zn,ej0                  j,                  Zej0                  j.                  ZddZddZ	 d	 	 	 	 	 ddZdddZddZddZddZy)z@Internal helpers for lock and condition coordination primitives.    )annotationsN)wait_for)AnyOptionalTypeVarregister_at_forkzweakref.WeakSet[threading.Lock]_forkable_locks_T)      c                 d    t        j                         } t        rt        j	                  |        | S )zpRepresents a lock that is tracked upon instantiation using a WeakSet and
    reset by pymongo upon forking.
    )	threadingLock_HAS_REGISTER_AT_FORKr	   addlocks    r/var/www/html/SchoolMeal/SchoolMeal/pds_admin_SchoolMeal/Backend/venv/lib/python3.12/site-packages/pymongo/lock.py_create_lockr   .   s&     >>DD!K    c                     t               S )zRepresents an asyncio.Lock.)r    r   r   _async_create_lockr   8   s	    6Mr   c                @    |r ||       S t        j                  |       S )z!Represents a threading.Condition.)r   	Conditionr   condition_classs     r   _create_conditionr   =   s#     t$$t$$r   c                ,    |r ||       S t        |       S )z Represents an asyncio.Condition.)r   r   s     r   _async_create_conditionr    F   s    t$$T?r   c                 \    t         D ]#  } | j                         s| j                          % y N)r	   lockedreleaser   s    r   _release_locksr%   M   s#     ;;=LLNr   c                   K   	 t        | j                         |       d {   S 7 # t        j                  $ r Y yw xY ww)NF)r   waitasyncioTimeoutError	conditiontimeouts     r   _async_cond_waitr-   T   s<     inn.8888 s,   A( &( A( >A>Ac                $    | j                  |      S r"   )r'   r*   s     r   
_cond_waitr/   [   s    >>'""r   )returnthreading.Lock)r0   r   r"   )r   r1   r   Optional[Any]r0   threading.Condition)r   r   r   r2   r0   r   )r0   None)r+   r   r,   Optional[float]r0   bool)r+   r3   r,   r5   r0   r6   ) __doc__
__future__r   r(   ossysr   weakrefr   typingr   r   r   pymongo._asyncio_lockpymongohasattrr   WeakSetr	   __annotations__r
   version_infor   r   _asyncio_lockr   r   r   r    r%   r-   r/   r   r   r   <module>rD      s    G "  	 
    ) ) $67  4C7??3D0 DT] w<<D!!I  %%D%%//I <@%
%+8%%#r   