//! In azur, dropping futures blocks the thread until the operation is done or cancelled. //! This is to prevent the kernel from writing to an invalid memory location if a future is dropped //! while the operation is still ongoing. //! //! This is an example of some code that could lead to undefined behavior if this safety guard was //! not implemented. use azur::DelayType; use futures_util::select; fn main() { let future = async { select! { _ = azur::delay( lx::timespec { tv_sec: 2, tv_nsec: 0, }, DelayType::Relative, ) => {}, _ = azur::delay( lx::timespec { tv_sec: 1, tv_nsec: 0, }, DelayType::Relative, ) => {}, } }; azur::spawn(future); azur::run().unwrap(); }