o
    l¨Êh¤  ã                   @   sœ   d dl Z d dlZd dlmZ ejdkrJejdd… dk rLd dlmZmZ zd dlm	Z	 W n e
yB   e jjjZe je_dd	„ Z	Y nw dd
d„ZdS dS dS )é    N)ÚsleepÚwin32é   )é   r   )ÚWaitForSingleObjectÚWAIT_OBJECT_0)Ú	monotonicc                   C   s
   t ƒ d S )z$Monotonic clock, cannot go backward.g     @�@)ÚGetTickCount64© r
   r
   úY/var/www/html/env/lib/python3.10/site-packages/joblib/externals/loky/backend/_win_wait.pyr      s   
r   c                 C   s”   |dur	t ƒ | }	 g }| D ]!}t|ƒttfv r%t|dƒtkr$||g7 }q| d¡r/| |¡ qt|ƒdkr8|S t	dƒ |durI|t ƒ  dkrIg S q
)a  Backward compat for python2.7

        This function wait for either:
        * one connection is ready for read,
        * one process handle has exited or got killed,
        * timeout is reached. Note that this function has a precision of 2
          msec.
        NTr   gü©ñÒMbP?)
r   ÚtypeÚintÚlongr   r   ÚpollÚappendÚlenr   )ÚhandlesÚtimeoutÚdeadlineÚreadyÚhr
   r
   r   Úwait!   s$   	

€

€ór   )N)ÚctypesÚsysÚtimer   ÚplatformÚversion_infoÚ_subprocessr   r   r   ÚImportErrorÚwindllÚkernel32r	   Úc_ulonglongÚrestyper   r
   r
   r
   r   Ú<module>   s   	
÷î