cargo-fmt
continuous-integration/drone/push Build is passing

Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
juju committed 2022-12-23 20:07:46 +01:00
1 parent b2ffbc34b5
commit 43eec9621c
17 files changed
+112 -132

No files matched your search

+5 -7
View File
@@ -3,26 +3,24 @@ use core::pin::Pin;
use core::sync::atomic::{AtomicBool, Ordering};
use core::task::{Context, Poll};
use lazy_static::lazy_static;
use futures_util::task::AtomicWaker;
use lazy_static::lazy_static;
lazy_static! {
pub static ref INTERRUPT_FUTURE: InterruptFuture = InterruptFuture::new();
static ref INTERRUPT: AtomicBool = AtomicBool::new(false);
}
static WAKER: AtomicWaker = AtomicWaker::new();
pub(crate) fn mark_interrupt() {
INTERRUPT.store(true, Ordering::Relaxed);
WAKER.wake();
}
#[derive(Copy,Clone)]
#[derive(Copy, Clone)]
pub struct InterruptFuture {
_private:(),
_private: (),
}
impl InterruptFuture {
@@ -51,8 +49,8 @@ impl Future for InterruptFuture {
true => {
WAKER.take();
Poll::Ready(())
},
}
false => Poll::Pending,
}
}
}
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.