66//! [`join()`]: ../join/join.fn.html
77
88use std:: any:: Any ;
9+ use std:: collections:: HashSet ;
910use std:: marker:: PhantomData ;
1011use std:: mem:: ManuallyDrop ;
1112use std:: sync:: atomic:: { AtomicPtr , Ordering } ;
1213use std:: sync:: { Arc , Mutex } ;
1314use std:: { fmt, ptr} ;
1415
15- use indexmap:: IndexSet ;
16-
1716use crate :: broadcast:: BroadcastContext ;
1817use crate :: job:: { ArcJob , HeapJob , JobFifo , JobRef , JobRefId } ;
1918use crate :: latch:: { CountLatch , Latch } ;
@@ -55,7 +54,8 @@ struct ScopeBase<'scope> {
5554 job_completed_latch : CountLatch ,
5655
5756 /// Jobs that have been spawned, but not yet started.
58- pending_jobs : Mutex < IndexSet < JobRefId > > ,
57+ #[ allow( rustc:: default_hash_types) ]
58+ pending_jobs : Mutex < HashSet < JobRefId > > ,
5959
6060 /// The worker which will wait on scope completion, if any.
6161 worker : Option < usize > ,
@@ -538,7 +538,7 @@ impl<'scope> Scope<'scope> {
538538 let scope = scope_ptr. as_ref ( ) ;
539539
540540 // Mark this job is started.
541- scope. base . pending_jobs . lock ( ) . unwrap ( ) . swap_remove_full ( & id) ;
541+ scope. base . pending_jobs . lock ( ) . unwrap ( ) . remove ( & id) ;
542542
543543 ScopeBase :: execute_job ( & scope. base , move || body ( scope) )
544544 } ) ;
@@ -569,7 +569,7 @@ impl<'scope> Scope<'scope> {
569569 let current_index = WorkerThread :: current ( ) . as_ref ( ) . map ( |worker| worker. index ( ) ) ;
570570 if current_index == scope. base . worker {
571571 // Mark this job as started on the scope's worker thread.
572- scope. base . pending_jobs . lock ( ) . unwrap ( ) . swap_remove ( & id) ;
572+ scope. base . pending_jobs . lock ( ) . unwrap ( ) . remove ( & id) ;
573573 }
574574
575575 let func = move || BroadcastContext :: with ( move |ctx| body ( scope, ctx) ) ;
@@ -611,7 +611,7 @@ impl<'scope> ScopeFifo<'scope> {
611611 let scope = scope_ptr. as_ref ( ) ;
612612
613613 // Mark this job is started.
614- scope. base . pending_jobs . lock ( ) . unwrap ( ) . swap_remove ( & id) ;
614+ scope. base . pending_jobs . lock ( ) . unwrap ( ) . remove ( & id) ;
615615
616616 ScopeBase :: execute_job ( & scope. base , move || body ( scope) )
617617 } ) ;
@@ -642,7 +642,7 @@ impl<'scope> ScopeFifo<'scope> {
642642 let current_index = WorkerThread :: current ( ) . as_ref ( ) . map ( |worker| worker. index ( ) ) ;
643643 if current_index == scope. base . worker {
644644 // Mark this job as started on the scope's worker thread.
645- scope. base . pending_jobs . lock ( ) . unwrap ( ) . swap_remove ( & id) ;
645+ scope. base . pending_jobs . lock ( ) . unwrap ( ) . remove ( & id) ;
646646 }
647647 let body = & body;
648648 let func = move || BroadcastContext :: with ( move |ctx| body ( scope, ctx) ) ;
@@ -664,7 +664,8 @@ impl<'scope> ScopeBase<'scope> {
664664 registry : Arc :: clone ( registry) ,
665665 panic : AtomicPtr :: new ( ptr:: null_mut ( ) ) ,
666666 job_completed_latch : CountLatch :: new ( owner) ,
667- pending_jobs : Mutex :: new ( IndexSet :: new ( ) ) ,
667+ #[ allow( rustc:: default_hash_types) ]
668+ pending_jobs : Mutex :: new ( HashSet :: new ( ) ) ,
668669 worker : owner. map ( |w| w. index ( ) ) ,
669670 marker : PhantomData ,
670671 tlv : tlv:: get ( ) ,
0 commit comments