@@ -416,18 +416,16 @@ impl Registry {
416416 if !worker_thread. is_null ( ) && ( * worker_thread) . registry ( ) . id ( ) == self . id ( ) {
417417 ( * worker_thread) . push ( job_ref) ;
418418 } else {
419- self . inject ( & [ job_ref] ) ;
419+ self . inject ( job_ref) ;
420420 }
421421 }
422422 }
423423
424424 /// Push a job into the "external jobs" queue; it will be taken by
425425 /// whatever worker has nothing to do. Use this if you know that
426426 /// you are not on a worker of this registry.
427- pub ( super ) fn inject ( & self , injected_jobs : & [ JobRef ] ) {
428- self . log ( || JobsInjected {
429- count : injected_jobs. len ( ) ,
430- } ) ;
427+ pub ( super ) fn inject ( & self , injected_job : JobRef ) {
428+ self . log ( || JobsInjected { count : 1 } ) ;
431429
432430 // It should not be possible for `state.terminate` to be true
433431 // here. It is only set to true when the user creates (and
@@ -442,12 +440,8 @@ impl Registry {
442440
443441 let queue_was_empty = self . injected_jobs . is_empty ( ) ;
444442
445- for & job_ref in injected_jobs {
446- self . injected_jobs . push ( job_ref) ;
447- }
448-
449- self . sleep
450- . new_injected_jobs ( usize:: MAX , injected_jobs. len ( ) as u32 , queue_was_empty) ;
443+ self . injected_jobs . push ( injected_job) ;
444+ self . sleep . new_injected_jobs ( usize:: MAX , 1 , queue_was_empty) ;
451445 }
452446
453447 fn has_injected_job ( & self ) -> bool {
@@ -547,7 +541,7 @@ impl Registry {
547541 } ,
548542 LatchRef :: new ( l) ,
549543 ) ;
550- self . inject ( & [ job. as_job_ref ( ) ] ) ;
544+ self . inject ( job. as_job_ref ( ) ) ;
551545 job. latch . wait_and_reset ( ) ; // Make sure we can use the same latch again next time.
552546
553547 // flush accumulated logs as we exit the thread
@@ -575,7 +569,7 @@ impl Registry {
575569 } ,
576570 latch,
577571 ) ;
578- self . inject ( & [ job. as_job_ref ( ) ] ) ;
572+ self . inject ( job. as_job_ref ( ) ) ;
579573 current_thread. wait_until ( & job. latch ) ;
580574 job. into_result ( )
581575 }
0 commit comments