#NEWLINE# def release( self ) : #NEWLINE# #INDENT# tid_gid = ( thread_get_ident ( ) , greenlet_get_ident ( ) ) #NEWLINE# if ( tid_gid != self . _owner ) : #NEWLINE# #INDENT# raise RuntimeError ( 'cannot release un-acquired lock' ) #NEWLINE# #UNINDENT# self . _count -= 1 #NEWLINE# if ( not self . _count ) : #NEWLINE# #INDENT# self . _owner = None #NEWLINE# gid = self . _wait_queue . pop ( 0 ) #NEWLINE# assert ( gid == tid_gid [ 1 ] ) #NEWLINE# self . _thread_local . greenlet_lock . release ( )