dualcache_ff/spawner/std_spawner.rs
1extern crate alloc;
2use super::DaemonSpawner;
3
4/// A default spawner using `std::thread::spawn` for `std` environments.
5#[derive(Debug, Clone, Copy, Default)]
6pub struct DefaultSpawner;
7
8impl DaemonSpawner for DefaultSpawner {
9 #[inline]
10 fn spawn(&self, f: alloc::boxed::Box<dyn FnOnce() + Send + 'static>) {
11 std::thread::spawn(move || f());
12 }
13}