2019-04-15 22:40:02 -07:00
|
|
|
use crate::common::*;
|
|
|
|
|
2019-09-21 15:35:03 -07:00
|
|
|
pub(crate) struct InterruptGuard;
|
2019-04-15 22:40:02 -07:00
|
|
|
|
|
|
|
impl InterruptGuard {
|
2020-01-15 02:16:13 -08:00
|
|
|
pub(crate) fn new() -> Self {
|
2019-04-15 22:40:02 -07:00
|
|
|
InterruptHandler::instance().block();
|
2020-01-15 02:16:13 -08:00
|
|
|
Self
|
2019-04-15 22:40:02 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Drop for InterruptGuard {
|
|
|
|
fn drop(&mut self) {
|
|
|
|
InterruptHandler::instance().unblock();
|
|
|
|
}
|
|
|
|
}
|