python (3.12.0)
͑e} d Z ddlZddlZddlZddlmZmZ ddlZddlZddl Z ddl
mZ ddlm
Z
ej ej d Zd Z G d d e Z G d
dej( Z G d d
e Z G d de Z G d de Z G d de Z G d de Z G d de Z G d de Z G d de Z G d de Zy)z/
Various tests for synchronization primitives.
N)start_new_threadTIMEOUT_MAX)support)threading_helperz9platform doesn't support fork (no _at_fork_reinit method)c . t j d y )N{Gz?)timesleep C/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/lock_tests.py_waitr s JJtr c * e Zd ZdZddZd Zd Zd Zy)Bunchz
A bunch of threads.
c _ | _ g _ g _ | _ t j _ j j fd} t | D ] }t |d y# d _ xY w)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 z t j } j j | j j | j
st
j
sy y # j j | j
st
j
sw w xY wN) threading get_identstartedappendfinished _can_exitr )tidfselfs r
taskzBunch.__init__.<locals>.task, s %%'CLL$
$$S)..G ..
$$S)..G ..s A9 9>B:8B:r TN)r nr r r r wait_threads_exitwait_thread __enter__ranger )r r r wait_before_exitr is `` r
__init__zBunch.__init__ s
--+==?""$ 1X
+ r*
+ !DNs !A>