%PDF- %PDF-
Direktori : /opt/plesk/python/2.7/lib64/python2.7/test/ |
Current File : //opt/plesk/python/2.7/lib64/python2.7/test/lock_tests.pyo |
� 5}�ac @ sH d Z d d l Z d d l Z d d l m Z m Z d d l Z d d l Z d d l m Z d � Z d e f d � � YZ d e j f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d e f d � � YZ d S( s/ Various tests for synchronization primitives. i����N( t start_new_threadt get_ident( t test_supportc C s t j d � d S( Ng{�G�z�?( t timet sleep( ( ( s8 /opt/plesk/python/2.7/lib64/python2.7/test/lock_tests.pyt _wait s t Bunchc B s5 e Z d Z e d � Z d � Z d � Z d � Z RS( s A bunch of threads. c s� � � _ | � _ g � _ g � _ | � _ � � f d � } y( x! t | � D] } t | d � qP WWn t � _ � n Xd S( s� 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 sS t � } � j j | � z � � Wd � j j | � x � j sM t � q: WXd S( N( R t startedt appendt finishedt _can_exitR ( t tid( t ft self( s8 /opt/plesk/python/2.7/lib64/python2.7/test/lock_tests.pyt task! s N( ( R t nR R R t rangeR t True( R R R t wait_before_exitR t i( ( R R s8 /opt/plesk/python/2.7/lib64/python2.7/test/lock_tests.pyt __init__ s c C s* x# t | j � | j k r% t � q Wd S( N( t lenR R R ( R ( ( s8 /opt/plesk/python/2.7/lib64/python2.7/test/lock_tests.pyt wait_for_started1 s c C s* x# t | j � | j k r% t � q Wd S( N( R R R R ( R ( ( s8 /opt/plesk/python/2.7/lib64/python2.7/test/lock_tests.pyt wait_for_finished5 s c C s t | _ d S( N( R R ( R ( ( s8 /opt/plesk/python/2.7/lib64/python2.7/test/lock_tests.pyt do_finish9 s ( t __name__t __module__t __doc__t FalseR R R R ( ( ( s8 /opt/plesk/python/2.7/lib64/python2.7/test/lock_tests.pyR s t BaseTestCasec B s e Z d � Z d � Z RS( c C s t j � | _ d S( N( t supportt threading_setupt _threads( R ( ( s8 /opt/plesk/python/2.7/lib64/python2.7/test/lock_tests.pyt setUp>