Your IP : 216.73.216.213


Current Path : /proc/242857/root/opt/alt/python34/lib64/python3.4/test/__pycache__/
Upload File :
Current File : //proc/242857/root/opt/alt/python34/lib64/python3.4/test/__pycache__/fork_wait.cpython-34.pyo

�
g fh�@s�dZddlZddlZddlZddlZddljZejd�ZdZ	dZ
dZGdd�dej�Z
dS)	arThis test case provides support for checking forking and wait behavior.

To test different wait behavior, override the wait_impl method.

We want fork1() semantics -- only the forking thread survives in the
child after a fork().

On some systems (e.g. Solaris without posix threads) we find that all
active threads survive in the child after a fork(); this is an error.
�N�_thread�g�?�c@sIeZdZdd�Zdd�Zdd�Zejdd��Zd	S)
�ForkWaitcCsi|_d|_dS)Nr)�alive�stop)�self�r	�3/opt/alt/python34/lib64/python3.4/test/fork_wait.py�setUps	zForkWait.setUpcCsMxF|jsHtj�|j|<ytjt�Wqtk
rDYqXqWdS)N)r�os�getpidr�time�sleep�
SHORTSLEEP�OSError)r�idr	r	r
�fs
z
ForkWait.fcCs�xPtd�D]B}tj|tj�\}}||kr>Pntjdt�q
W|j||�|j|dd|d@|d?f�dS)N�
rrzcause = %d, exit = %d��)�ranger�waitpid�WNOHANGrrr�assertEqual)r�cpid�iZspidZstatusr	r	r
�	wait_impl"szForkWait.wait_implcCs-x*tt�D]}tj|j|f�q
Wtjt�t|j	j
��}|j|ttt���|j	j
�}tjdkr�tj�}ntj�}|dkrtjt�d}x5|j	D]*}|j	|||kr�|d7}q�q�Wtj|�nz|j|�Wdd|_XdS)N�	unixware7r�)r)r�NUM_THREADSr�	start_newrrr�	LONGSLEEP�sortedr�keysr�list�copy�sys�platformrZfork1�fork�_exitrr)rr�aZ
prefork_livesr�n�keyr	r	r
�	test_wait.s&

zForkWait.test_waitN)	�__name__�
__module__�__qualname__rrr�supportZreap_threadsr.r	r	r	r
rsr)�__doc__rr'rZunittestZtest.supportr2�
import_modulerr"rr ZTestCaserr	r	r	r
�<module>
s0