@@ -96,7 +96,7 @@ macro_rules! parallel {
96
96
pub fn spawn ( func : impl FnOnce ( ) + DynSend + ' static ) {
97
97
if mode:: is_dyn_thread_safe ( ) {
98
98
let func = FromDyn :: from ( func) ;
99
- rayon_core :: spawn ( || {
99
+ rustc_thread_pool :: spawn ( || {
100
100
( func. into_inner ( ) ) ( ) ;
101
101
} ) ;
102
102
} else {
@@ -107,11 +107,11 @@ pub fn spawn(func: impl FnOnce() + DynSend + 'static) {
107
107
// This function only works when `mode::is_dyn_thread_safe()`.
108
108
pub fn scope < ' scope , OP , R > ( op : OP ) -> R
109
109
where
110
- OP : FnOnce ( & rayon_core :: Scope < ' scope > ) -> R + DynSend ,
110
+ OP : FnOnce ( & rustc_thread_pool :: Scope < ' scope > ) -> R + DynSend ,
111
111
R : DynSend ,
112
112
{
113
113
let op = FromDyn :: from ( op) ;
114
- rayon_core :: scope ( |s| FromDyn :: from ( op. into_inner ( ) ( s) ) ) . into_inner ( )
114
+ rustc_thread_pool :: scope ( |s| FromDyn :: from ( op. into_inner ( ) ( s) ) ) . into_inner ( )
115
115
}
116
116
117
117
#[ inline]
@@ -124,7 +124,7 @@ where
124
124
let oper_a = FromDyn :: from ( oper_a) ;
125
125
let oper_b = FromDyn :: from ( oper_b) ;
126
126
let ( a, b) = parallel_guard ( |guard| {
127
- rayon_core :: join (
127
+ rustc_thread_pool :: join (
128
128
move || guard. run ( move || FromDyn :: from ( oper_a. into_inner ( ) ( ) ) ) ,
129
129
move || guard. run ( move || FromDyn :: from ( oper_b. into_inner ( ) ( ) ) ) ,
130
130
)
@@ -158,7 +158,7 @@ fn par_slice<I: DynSend>(
158
158
let ( left, right) = items. split_at_mut ( items. len ( ) / 2 ) ;
159
159
let mut left = state. for_each . derive ( left) ;
160
160
let mut right = state. for_each . derive ( right) ;
161
- rayon_core :: join ( move || par_rec ( * left, state) , move || par_rec ( * right, state) ) ;
161
+ rustc_thread_pool :: join ( move || par_rec ( * left, state) , move || par_rec ( * right, state) ) ;
162
162
}
163
163
}
164
164
@@ -241,7 +241,7 @@ pub fn par_map<I: DynSend, T: IntoIterator<Item = I>, R: DynSend, C: FromIterato
241
241
pub fn broadcast < R : DynSend > ( op : impl Fn ( usize ) -> R + DynSync ) -> Vec < R > {
242
242
if mode:: is_dyn_thread_safe ( ) {
243
243
let op = FromDyn :: from ( op) ;
244
- let results = rayon_core :: broadcast ( |context| op. derive ( op ( context. index ( ) ) ) ) ;
244
+ let results = rustc_thread_pool :: broadcast ( |context| op. derive ( op ( context. index ( ) ) ) ) ;
245
245
results. into_iter ( ) . map ( |r| r. into_inner ( ) ) . collect ( )
246
246
} else {
247
247
vec ! [ op( 0 ) ]
0 commit comments