#NEWLINE# def _timed_queue_join( self , timeout ) : #NEWLINE# #INDENT# "\n        implementation of Queue.join which takes a 'timeout' argument\n\n        returns true on success, false on timeout\n        " #NEWLINE# deadline = ( time ( ) + timeout ) #NEWLINE# queue = self . _queue #NEWLINE# queue . all_tasks_done . acquire ( ) #NEWLINE# try : #NEWLINE# #INDENT# while queue . unfinished_tasks : #NEWLINE# #INDENT# delay = ( deadline - time ( ) ) #NEWLINE# if ( delay <= 0 ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# queue . all_tasks_done . wait ( timeout = delay ) #NEWLINE# #UNINDENT# return True #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# queue . all_tasks_done . release ( )