1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
use std::{sync::Arc, task::Wake}; pub(crate) struct Thread(std::thread::Thread); impl Default for Thread { fn default() -> Self { Self(std::thread::current()) } } impl Wake for Thread { fn wake(self: Arc<Self>) { self.0.unpark(); } }