#interrupt #signals #disable #no-alloc #signal #without

no-std interrupts

Cross-architecture utilities for temporarily disabling interrupts and signals

3 releases

0.1.5 Feb 26, 2024
0.1.4 Nov 2, 2023
0.1.3 Oct 9, 2023
0.1.0 Sep 18, 2023

#204 in Unix APIs

Download history 382/week @ 2023-12-18 20/week @ 2023-12-25 176/week @ 2024-01-01 373/week @ 2024-01-08 443/week @ 2024-01-15 479/week @ 2024-01-22 491/week @ 2024-01-29 617/week @ 2024-02-05 766/week @ 2024-02-12 639/week @ 2024-02-19 987/week @ 2024-02-26 547/week @ 2024-03-04 636/week @ 2024-03-11 500/week @ 2024-03-18 705/week @ 2024-03-25 716/week @ 2024-04-01

2,581 downloads per month
Used in 4 crates (3 directly)

MIT/Apache

14KB
166 lines

interrupts

Crates.io docs.rs CI

Cross-architecture utilities for temporarily disabling interrupts and signals.

Use disable to disable interrupts with a guard:

// interrupts may or may not be enabled
let guard = interrupts::disable();
// interrupts are disabled
drop(guard);
// interrupts are restored to the previous state

Use without to run a closure with disabled interrupts:

// interrupts may or may not be enabled
interrupts::without(|| {
    // interrupts are disabled
});
// interrupts are restored to the previous state

For API documentation, see the docs.

  • interrupt-ref-cell (A RefCell for sharing data with interrupt handlers or signal handlers on the same thread.)
  • interrupt-mutex (A mutex for sharing data with interrupt handlers or signal handlers.)

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~1.5MB
~35K SLoC