Current File : //opt/imh-python/lib/python2.7/test/fork_wait.pyo
�
��Wc@s�dZddlZddlZddlZddlZddljZejd�ZdZ	dZ
dZdejfd��YZ
dS(	s�This 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.

While BeOS doesn't officially support fork and native threading in
the same application, the present example should work just fine.  DC
i����Ntthreadig�?itForkWaitcBs,eZd�Zd�Zd�Zd�ZRS(cCsi|_d|_dS(Ni(talivetstop(tself((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/fork_wait.pytsetUps	cCsLxE|jsGtj�|j|<ytjt�Wqtk
rCqXqWdS(N(RtostgetpidRttimetsleept
SHORTSLEEPtIOError(Rtid((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/fork_wait.pytfs
cCs�xPtd�D]B}tj|tj�\}}||kr>Pntjdt�q
W|j||�|j|dd|d@|d?f�dS(Ni
iiscause = %d, exit = %di�i(trangeRtwaitpidtWNOHANGRR	R
tassertEqual(Rtcpidtitspidtstatus((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/fork_wait.pyt	wait_impl%scCs4x*tt�D]}tj|j|f�q
Wtjt�|jj	�}|j
�|j|tt��|jj�}t
jdkr�tj�}ntj�}|dkr	tjt�d}x5|jD]*}|j|||kr�|d7}q�q�Wtj|�n'|j|�d|_tjdt�dS(Nt	unixware7iii(R(RtNUM_THREADSRt	start_newR
RR	t	LONGSLEEPRtkeystsortRtcopytsystplatformRtfork1tforkt_exitRRR
(RRtat
prefork_livesRtntkey((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/fork_wait.pyt	test_wait1s(



	(t__name__t
__module__RR
RR'(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/fork_wait.pyRs			(t__doc__RRRtunittestttest.test_supportttest_supportt
import_moduleRRR
RtTestCaseR(((sg/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/fork_wait.pyt<module>
s0