1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
U
Z±dÖã@sLddlZddlmZddlZddlmZmZmZmZm    Z    dd„Z
dd„Z dS)    éNé)Ú    _timeouts)ÚffiÚkernel32Ú
ErrorCodesÚraise_winerrorÚ_handlec    ÃsŒt|ƒ}t |d¡}|tjkr&tƒn|tjkr4dSt tj    ddtj    ¡}z(t j jt||dt  tj¡dIdHW5t 
|¡t  |¡XdS)zÝAsync and cancellable variant of WaitForSingleObject. Windows only.
 
    Args:
      handle: A Win32 handle, as a Python integer.
 
    Raises:
      OSError: If the handle is invalid, e.g. when it is already closed.
 
    rNTF)Z cancellableZlimiter)rrÚWaitForSingleObjectrÚ WAIT_FAILEDrÚ WAIT_TIMEOUTZ CreateEventArÚNULLZSetEventÚ CloseHandleÚtrioZ    to_threadZrun_syncÚWaitForMultipleObjects_syncZCapacityLimiterÚmathÚinf)ÚobjÚhandleÚretcodeZ cancel_handle©rúLd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\trio/_wait_for_object.pyr     s"  
 
 
û
 
r    cGsZt|ƒ}t d |¡¡}t|ƒD]}||||<q d}t ||d|¡}|tjkrVt    ƒdS)z9Wait for any of the given Windows handles to be signaled.z
HANDLE[{}]lÿÿFN)
ÚlenrÚnewÚformatÚrangerÚWaitForMultipleObjectsrr
r)ZhandlesÚnZ
handle_arrÚiÚtimeoutrrrrr5s 
r) rÚrrZ_core._windows_cffirrrrrr    rrrrrÚ<module>s
     (