shell bypass 403
o
`b�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
�8/usr/local/python-3.10/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 Zwait_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>