python (3.11.7)

(root)/
lib/
python3.11/
test/
__pycache__/
fork_wait.cpython-311.opt-1.pyc

e|dZddlZddlZddlZddlZddlZddlmZddlm	Z	dZ
dZdZGdd	ej
ZdS)
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)support)threading_helperg?c,eZdZdZdZdZdZdZdS)ForkWaitc`tj|_i|_d|_g|_dS)Nr)rthreading_setup_threading_keyalivestopthreads)selfs B/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/fork_wait.pysetUpzForkWait.setUps,.>@@
	cd|_|jD]}|d}|jt	j|jdS)N)r
rjoinclearrthreading_cleanupr)rthreads  rtearDownzForkWait.tearDownsY	l		FKKMMMM*D,?@@@@rc|jsOtj|j|<	t	jtn#t$rYnwxYw|jMdSdS)N)r
osgetpidrtimesleep
SHORTSLEEPOSError)rids  rfz
ForkWait.f'su)	Y[[DJrN

:&&&&



	)					s>
A
Ac2tj||dS)Nexitcode)rwait_process)rcpidr%s   r	wait_implzForkWait.wait_impl/sTH555555rcttD]L}tj|j|f}||j|Mtj	tj
dD]!}t|jtkrn"t|j}||t!tt|j}t$jdvrt)j}nt)j}|dkrWt/jt2d}|jD]}|j|||kr|dz
}t)j|dS||ddS)N)targetargsF)error)	unixware7rrr$)rangeNUM_THREADS	threadingThreadr"startrappendrsleeping_retry
SHORT_TIMEOUTlenrsortedkeysassertEquallistcopysysplatformrfork1forkrr	LONGSLEEP_exitr()	rir_a
prefork_livesr'nkeys	         r	test_waitzForkWait.test_wait2s{##	(	(A%TV1$???FLLNNNL'''''(=UKKK		A4:+--.
4:??$$%%D{!3!344555
))
<=((8::DD799D199Jy!!!Az

:c?mC&888FAHQKKKKK
NN4!N,,,,,rN)__name__
__module____qualname__rrr"r(rHrrrrsbAAA666-----rr)__doc__rr<runittestr0testrtest.supportrr@rr/TestCaserrLrr<module>rRs		))))))
	

;-;-;-;-;-x ;-;-;-;-;-r