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__/test_fork1.cpython-38.pyc
U

>��g��@s�dZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm
Z
mZe
ed�Gdd�de
�Zdd	�Zed
kr�e��dS)z.This test checks for correct fork() behavior.
�N)�ForkWait)�
reap_children�
get_attribute�verbose�forkc@s$eZdZdd�Zdd�Zdd�ZdS)�ForkTestcCsnt��d}t��|kr@t�|tj�\}}||kr4q@t�d�q|�||�|�|dd|d@|d?f�dS)Ng$@g�������?rzcause = %d, exit = %d��)�time�	monotonic�os�waitpid�WNOHANG�sleepZassertEqual)�selfZcpid�deadlineZspid�status�r�./opt/cppython/lib/python3.8/test/test_fork1.py�	wait_implszForkTest.wait_implcs�t���d�d�d�����fdd�}tj|d�}|�����t��}zR|s�t��}|�krlt�d�q�t
dkr|td	�t�d�n|��|�|�W5zt�|tj	�Wnt
k
r�YnXXd
S)zFCheck fork() in main thread works while a subthread is doing an importzfake test module�partialZcompletecs:t���tj�<���t�d��tj�<t��dS)Ng{�G�z�?)�imp�acquire_lock�sys�modules�setr
r�release_lockr�Zcomplete_moduleZfake_module_nameZimport_startedZpartial_modulerr�importer's


z9ForkTest.test_threaded_import_lock_fork.<locals>.importer)�targetr�z Child encountered partial moduleN)�	threading�Event�Thread�start�waitrr�kill�signal�SIGKILL�OSError�
__import__�_exitr�print�joinr)rr�t�pid�mrrr�test_threaded_import_lock_fork!s.z'ForkTest.test_threaded_import_lock_forkcs&�fdd�}td�D]}||�qdS)zJCheck fork() in main thread works while the main thread is doing an importc	s�d}d}zNz0t|�D]}t��|d7}qt��}|}W5t|�D]}t��qDXWn4tk
r�|r�tdkrztd�t�	d��YnX|r�t�	d���
|�dS)NrFr zRuntimeError in child)�rangerrrrr�RuntimeErrorrr,r+r)�level�releaseZin_child�ir/�rrr�fork_with_import_lockNs(



zDForkTest.test_nested_import_lock_fork.<locals>.fork_with_import_lock�N)r2)rr8r4rr7r�test_nested_import_lock_forkKsz%ForkTest.test_nested_import_lock_forkN)�__name__�
__module__�__qualname__rr1r:rrrrrs
*rcCs
t�dS)N)rrrrr�tearDownModuleksr>�__main__)�__doc__�_imprrr'rr!r
ZunittestZtest.fork_waitrZtest.supportrrrrr>r;�mainrrrr�<module>s
X

F1le Man4ger