Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/test/__pycache__/fork_wait.cpython-38.opt-1.pyc
U

>��g
�@sZdZddlZddlZddlZddlZddlZddlmZdZdZ	dZ
Gdd�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�g�?�c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�ForkWaitcCs t��|_i|_d|_g|_dS)Nr)�supportZthreading_setup�_threading_key�alive�stop�threads)�self�r�-/opt/cppython/lib/python3.8/test/fork_wait.py�setUps
zForkWait.setUpcCs8d|_|jD]}|��qd}|j��tj|j�dS)N�)rr	�join�clearrZthreading_cleanupr)r
�threadrrr�tearDowns


zForkWait.tearDowncCs>|js:t��|j|<zt�t�Wqtk
r6YqXqdS)N)r�os�getpidr�time�sleep�
SHORTSLEEP�OSError)r
�idrrr�f&sz
ForkWait.fcCshtd�D]0}t�|tj�\}}||kr*q:t�dt�q|�||�|�|dd|d@|d?f�dS)N�
rrzcause = %d, exit = %d��)�ranger�waitpid�WNOHANGrrr�assertEqual)r
�cpid�iZspid�statusrrr�	wait_impl.szForkWait.wait_implc	Cstt�D]*}tj|j|fd�}|��|j�|�qt�	�d}t
|j�tkrht�d�|t�	�kr@qhq@t
|j���}|�|ttt���|j��}tjdkr�t��}nt��}|dkr�t�t�d}|jD]}|j|||kr�|d7}q�t�|�n
|�|�dS)N)�target�argsg$@g�������?)Z	unixware7rr)r�NUM_THREADS�	threading�Threadr�startr	�appendr�	monotonic�lenrr�sorted�keysr!�list�copy�sys�platformrZfork1�fork�	LONGSLEEP�_exitr%)	r
r#r�deadline�aZ
prefork_livesr"�n�keyrrr�	test_wait:s.






zForkWait.test_waitN)�__name__�
__module__�__qualname__r
rrr%r<rrrrrs
	r)
�__doc__rr3rZunittestr)Ztest.supportrr6rr(ZTestCaserrrrr�<module>s 

F1le Man4ger