#NEWLINE# def test_reacquire( self ) : #NEWLINE# #INDENT# lock = self . locktype ( ) #NEWLINE# phase = [ ] #NEWLINE# def f( ) : #NEWLINE# #INDENT# lock . acquire ( ) #NEWLINE# phase . append ( None ) #NEWLINE# lock . acquire ( ) #NEWLINE# phase . append ( None ) #NEWLINE# #UNINDENT# start_new_thread ( f , ( ) ) #NEWLINE# while ( len ( phase ) == 0 ) : #NEWLINE# #INDENT# _wait ( ) #NEWLINE# #UNINDENT# _wait ( ) #NEWLINE# self . assertEqual ( len ( phase ) , 1 ) #NEWLINE# lock . release ( ) #NEWLINE# while ( len ( phase ) == 1 ) : #NEWLINE# #INDENT# _wait ( ) #NEWLINE# #UNINDENT# self . assertEqual ( len ( phase ) , 2 )