File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -34,14 +34,18 @@ pub enum PreferWorkerKind {
34
34
Multithreaded ,
35
35
}
36
36
37
+
37
38
/// Execute something with a worker system.
38
39
pub fn with_worker < T > ( prefer : PreferWorkerKind , f : impl FnOnce ( & mut dyn Worker ) -> T ) -> T {
40
+ #[ cfg( any( target_arch = "asmjs" , target_arch = "wasm32" ) ) ]
41
+ {
42
+ return self :: immediate:: with_immediate ( f) ;
43
+ }
39
44
match prefer {
40
- #[ cfg( not( any( target_arch = "asmjs" , target_arch = "wasm32" ) ) ) ]
41
45
#[ cfg( feature = "rayon" ) ]
42
46
PreferWorkerKind :: Multithreaded => self :: rayon:: with_rayon ( f) ,
43
- #[ cfg( not( any( target_arch = "asmjs" , target_arch = "wasm32" ) ) ) ]
44
47
PreferWorkerKind :: Multithreaded => self :: multithreaded:: with_multithreading ( f) ,
45
48
_ => self :: immediate:: with_immediate ( f) ,
46
49
}
47
50
}
51
+
You can’t perform that action at this time.
0 commit comments