#NEWLINE# def lock( self , function , argument ) : #NEWLINE# #INDENT# 'Lock a mutex, call the function with supplied argument\n        when it is acquired.  If the mutex is already locked, place\n        function and argument in the queue.' #NEWLINE# if self . testandset ( ) : #NEWLINE# #INDENT# function ( self ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . queue . append ( ( function , argument ) )