#NEWLINE# def release( self ) : #NEWLINE# #INDENT# '\n        Release the lock.  If there is a waiting list, then the first\n        L{Deferred} in that waiting list will be called back.\n\n        Should be called by whomever did the L{acquire}() when the shared\n        resource is free.\n        ' #NEWLINE# assert self . locked , 'Tried to release an unlocked lock' #NEWLINE# self . locked = False #NEWLINE# if self . waiting : #NEWLINE# #INDENT# self . locked = True #NEWLINE# d = self . waiting . pop ( 0 ) #NEWLINE# d . callback ( self )