#NEWLINE# def _build_preparation_loop( self ) : #NEWLINE# #INDENT# '\n        Grabs a build off the request_queue (populated by self.handle_build_request()), prepares it,\n        and puts that build onto the self.builds_waiting_for_slaves queue.\n        ' #NEWLINE# while True : #NEWLINE# #INDENT# build = self . _request_queue . get ( ) #NEWLINE# project_id = build . project_type . project_id ( ) #NEWLINE# if ( project_id not in self . _project_preparation_locks ) : #NEWLINE# #INDENT# self . _logger . info ( 'Creating project lock [{}] for build {}' , project_id , str ( build . build_id ( ) ) ) #NEWLINE# self . _project_preparation_locks [ project_id ] = Lock ( ) #NEWLINE# #UNINDENT# project_lock = self . _project_preparation_locks [ project_id ] #NEWLINE# SafeThread ( target = self . _prepare_build_async , name = 'Bld{}-PreparationThread' . format ( build . build_id ( ) ) , args = ( build , project_lock ) ) . start ( )