1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
use super::*; pub struct InterruptGuard; impl InterruptGuard { pub fn new() -> Self { InterruptHandler::instance().block(); Self } } impl Drop for InterruptGuard { fn drop(&mut self) { InterruptHandler::instance().unblock(); } }