%PDF- %PDF-
Direktori : /usr/local/lib/python2.7/test/ |
Current File : //usr/local/lib/python2.7/test/lock_tests.pyc |
ó Nêá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( ( ( s+ /usr/local/lib/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( s+ /usr/local/lib/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 s+ /usr/local/lib/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 ( ( s+ /usr/local/lib/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 ( ( s+ /usr/local/lib/python2.7/test/lock_tests.pyt wait_for_finished5 s c C s t | _ d S( N( R R ( R ( ( s+ /usr/local/lib/python2.7/test/lock_tests.pyt do_finish9 s ( t __name__t __module__t __doc__t FalseR R R R ( ( ( s+ /usr/local/lib/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 ( ( s+ /usr/local/lib/python2.7/test/lock_tests.pyt setUp>