File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 10
10
//! In other words, `zephyr::sys::Queue` is a Rust friendly implementation of `k_queue` in Zephyr.
11
11
//! This module provides `Sender` and `Receiver`, which can be cloned and behave as if they had an
12
12
//! internal `Arc` inside them, but without the overhead of an actual Arc.
13
+ //!
14
+ //! ## IRQ safety
15
+ //!
16
+ //! These channels are usable from IRQ context on Zephyr in very limited situations. Notably, all
17
+ //! of the following must be true:
18
+ //! - The channel has been created with `bounded()`, which pre-allocates all of the messages.
19
+ //! - If the type `T` has a Drop implementation, this implementation can be called from IRQ context.
20
+ //! - Only `try_send` or `try_recv` are used on the channel.
21
+ //!
22
+ //! The requirement for Drop is only strictly true if the IRQ handler calls `try_recv` and drops
23
+ //! received message. If the message is *always* sent over another channel or otherwise not
24
+ //! dropped, it *might* be safe to use these messages.
13
25
14
26
extern crate alloc;
15
27
You can’t perform that action at this time.
0 commit comments