@@ -14,6 +14,7 @@ use std::{
1414 atomic:: { AtomicBool , AtomicU64 , AtomicUsize , Ordering } ,
1515 } ,
1616 thread:: available_parallelism,
17+ time:: Duration ,
1718} ;
1819
1920use anyhow:: { Result , bail} ;
@@ -22,7 +23,8 @@ use indexmap::IndexSet;
2223use parking_lot:: { Condvar , Mutex } ;
2324use rustc_hash:: { FxHashMap , FxHashSet , FxHasher } ;
2425use smallvec:: { SmallVec , smallvec} ;
25- use tokio:: time:: { Duration , Instant } ;
26+ #[ cfg( not( all( target_family = "wasm" , target_os = "unknown" ) ) ) ]
27+ use tokio:: time:: { Instant , sleep_until} ;
2628use tracing:: field:: Empty ;
2729use turbo_tasks:: {
2830 CellId , FxDashMap , KeyValuePair , RawVc , ReadCellOptions , ReadConsistency , SessionId ,
@@ -40,6 +42,8 @@ use turbo_tasks::{
4042 turbo_tasks,
4143 util:: IdFactoryWithReuse ,
4244} ;
45+ #[ cfg( all( target_family = "wasm" , target_os = "unknown" ) ) ]
46+ use wasmtimer:: { std:: Instant , tokio:: sleep_until} ;
4347
4448pub use self :: { operation:: AnyOperation , storage:: TaskDataCategory } ;
4549#[ cfg( feature = "trace_task_dirty" ) ]
@@ -2158,10 +2162,10 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
21582162 idle_time = until + IDLE_TIMEOUT ;
21592163 idle_end_listener = self . idle_end_event. listen( )
21602164 } ,
2161- _ = tokio :: time :: sleep_until( until) => {
2165+ _ = sleep_until( until) => {
21622166 break ;
21632167 } ,
2164- _ = tokio :: time :: sleep_until( idle_time) => {
2168+ _ = sleep_until( idle_time) => {
21652169 if turbo_tasks. is_idle( ) {
21662170 break ;
21672171 }
0 commit comments