Your IP : 3.15.214.244


Current Path : /opt/alt/python34/lib64/python3.4/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/multiprocessing/__pycache__/popen_spawn_win32.cpython-34.pyc

�
e f��@s�ddlZddlZddlZddlZddlZddlmZddlmZddlmZddlm	Z	dgZ
dZejd	ko�e
ed
d�Zejj�jd�ZGd
d�de�ZdS)�N�)�context)�spawn)�	reduction)�util�Popeni�win32�frozenFzpythonservice.exec@s[eZdZdZdZdd�Zdd�Zddd	�Zd
d�Zdd
�Z	dS)rz@
    Start a subprocess to run the code of a process object
    rcCs�tj|j�}tjdd�\}}tj|d�}tjdtj	�d|�}dj
dd�|D��}t|ddd	���}yJtjtj
�|ddd
dddd�	\}}	}
}tj|	�Wntj|��YnX|
|_d|_||_t|�|_tj|tj|jf�tj|�z$tj||�tj||�Wdtjd�XWdQXdS)NrZ
parent_pidZpipe_handle� css|]}d|VqdS)z"%s"N�)�.0�xrr�F/opt/alt/python34/lib64/python3.4/multiprocessing/popen_spawn_win32.py�	<genexpr>*sz!Popen.__init__.<locals>.<genexpr>�wb�closefdTF)rZget_preparation_data�_name�_winapiZ
CreatePipe�msvcrtZopen_osfhandleZget_command_line�os�getpid�join�openZ
CreateProcessZget_executableZCloseHandle�pid�
returncode�_handle�int�sentinelrZFinalizerZset_spawning_popenr�dump)�selfZprocess_objZ	prep_dataZrhandleZwhandleZwfd�cmdZto_childZhpZhtr�tidrrr�__init__!s2	'
			
zPopen.__init__cCs+|tj�kst�tj||j�S)N)rZget_spawning_popen�AssertionErrorrZ	duplicater)rZhandlerrr�duplicate_for_childFszPopen.duplicate_for_childNcCs�|jdkr�|dkr'tj}ntdt|dd��}tjt|j�|�}|tjkr�tj|j�}|t	kr�t
j}n||_q�n|jS)Nri�g�?)rrZINFINITE�maxrZWaitForSingleObjectrZ
WAIT_OBJECT_0ZGetExitCodeProcess�	TERMINATE�signal�SIGTERM)r�timeoutZmsecs�res�coderrr�waitJs
z
Popen.waitcCs|jdd�S)Nr)r)r,)rrrr�pollZsz
Popen.pollcCsf|jdkrbytjt|j�t�Wqbtk
r^|jdd�dkrZ�nYqbXndS)Nr)g�?)rrZTerminateProcessrrr&�OSErrorr,)rrrr�	terminate]s
zPopen.terminate)
�__name__�
__module__�__qualname__�__doc__�methodr"r$r,r-r/rrrrrs%)rrr'�sysr�rrrr�__all__r&�platform�getattrZWINEXE�
executable�lower�endswithZ
WINSERVICE�objectrrrrr�<module>s	!

?>