#NEWLINE# def submit( self , fn , * args , **kwargs ) : #NEWLINE# #INDENT# with self . _shutdown_lock : #NEWLINE# #INDENT# if self . _shutdown : #NEWLINE# #INDENT# raise RuntimeError ( 'cannot schedule new futures after shutdown' ) #NEWLINE# #UNINDENT# f = _base . Future ( ) #NEWLINE# w = _WorkItem ( f , fn , args , kwargs ) #NEWLINE# self . _work_queue . put ( self ) #NEWLINE# self . _adjust_thread_count ( ) #NEWLINE# return f