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_dummy_threading.cpython-38.pyc
U

>��g��@sJddlmZddlZddlZddlZGdd�dej�ZedkrFe�	�dS)�)�supportNc@s.eZdZGdd�dej�Zdd�Zdd�ZdS)�DummyThreadingTestCasec@seZdZdd�ZdS)z!DummyThreadingTestCase.TestThreadcCs�d}tjrtd|jd|d�t��t��td7atjrDttd�t��t	�
|�tjrjtd|jd�t��td8atjr�t|jdtd�t��t��dS)	NrZtaskzwill run forZsec�ztasks are running�donezis finished.)r�verbose�print�name�sema�acquire�mutex�running�release�time�sleep)�self�delay�r�8/opt/cppython/lib/python3.8/test/test_dummy_threading.py�run
s$

z%DummyThreadingTestCase.TestThread.runN)�__name__�
__module__�__qualname__rrrrr�
TestThreadsrcCs(d|_tjdd�at��adag|_dS)N�
�)�valuer)�numtasks�
_threading�BoundedSemaphorer	�RLockrr�threads)rrrr�setUp$s
zDummyThreadingTestCase.setUpcCsht|j�D](}|jd|d�}|j�|�|��q
tjrBtd�|jD]}|�	�qHtjrdtd�dS)Nz<thread %d>)rz!waiting for all tasks to completezall tasks done)
�rangerrr �append�startrrr�join)r�i�trrr�
test_tasks.s


z!DummyThreadingTestCase.test_tasksN)rrrr�Threadrr!r(rrrrrs
r�__main__)
�testrZunittestZdummy_threadingrrZTestCaserr�mainrrrr�<module>s5

F1le Man4ger