1 use std::future::Future; 2 3 cfg_rt! { 4 pub(crate) fn block_on<F: Future>(f: F) -> F::Output { 5 let mut e = crate::runtime::enter::enter(false); 6 e.block_on(f).unwrap() 7 } 8 } 9 10 cfg_not_rt! { 11 pub(crate) fn block_on<F: Future>(f: F) -> F::Output { 12 let mut park = crate::park::thread::CachedParkThread::new(); 13 park.block_on(f).unwrap() 14 } 15 } 16