HEX
Server: Apache
System: FreeBSD www860.sakura.ne.jp 13.0-RELEASE-p14 FreeBSD 13.0-RELEASE-p14 #2: Mon Dec 9 13:54:55 JST 2024 root@www5301.sakura.ne.jp:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
User: yoyo0427 (1306)
PHP: 8.3.8
Disabled: NONE
Upload Files
File: //usr/local/lib/python2.7/test/fork_wait.pyo
�
N��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((s*/usr/local/lib/python2.7/test/fork_wait.pytsetUps		cCsHd|_x|jD]}|j�qWd}|j2tj|j�dS(Ni(RRtjointNoneRtthreading_cleanupR(Rtthread((s*/usr/local/lib/python2.7/test/fork_wait.pyttearDown s	cCsLxE|jsGtj�|j|<ytjt�Wqtk
rCqXqWdS(N(RtostgetpidRttimetsleept
SHORTSLEEPtIOError(Rtid((s*/usr/local/lib/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((s*/usr/local/lib/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((s*/usr/local/lib/python2.7/test/fork_wait.pyt	test_wait=s(



(t__name__t
__module__R	RRRR4(((s*/usr/local/lib/python2.7/test/fork_wait.pyRs
					(t__doc__RR+Rtunittestttest.supportRt
import_moduleRR'RR#tTestCaseR(((s*/usr/local/lib/python2.7/test/fork_wait.pyt<module>
s0