| Server IP : 3.111.61.48 / Your IP : 216.73.216.67 Web Server : Apache System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.2.31 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3.10/test/__pycache__/ |
Upload File : |
o
�9j�x � @ s4 d Z ddlZddlZddlZddlZddlmZmZ ddlZddl Z ddl
Z
ddlmZ ddl
mZ e �eed�d�Zdd � ZG d
d� de�ZG dd
� d
e j�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZdS ) z/
Various tests for synchronization primitives.
� N)�start_new_thread�TIMEOUT_MAX)�support)�threading_helper�forkz9platform doesn't support fork (no _at_fork_reinit method)c C s t �d� d S )N�{�G�z�?)�time�sleep� r
r
�&/usr/lib/python3.10/test/lock_tests.py�_wait s r c @ s2 e Zd ZdZddd�Zdd� Zdd� Zd d
� ZdS )
�Bunchz
A bunch of threads.
Fc sp � �_ |�_g �_g �_| �_t�� �_�j�� � �fdd�}zt |�D ]}t
|d� q&W dS d�_� )z�
Construct a bunch of `n` threads running the same function `f`.
If `wait_before_exit` is True, the threads won't terminate until
do_finish() is called.
c sd t �� } �j�| � z� � W �j�| � �js t� �jrd S d S �j�| � �js1t� �jr+w �N)� threading� get_ident�started�append�finished� _can_exitr )�tid��f�selfr
r �task- s ���zBunch.__init__.<locals>.taskr
TN)r �nr r r r �wait_threads_exit�wait_thread� __enter__�ranger )r r r �wait_before_exitr �ir
r r �__init__ s
�zBunch.__init__c C s. t | j�| jk rt� t | j�| jk sd S d S r )�lenr r r �r r
r
r �wait_for_started>