Skip to content

Commit

Permalink
feat: add all-one-shot feature
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed Apr 3, 2024
1 parent cf14aa2 commit 2763e5d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ one-shot-mutex = "0.1.0"

[dev-dependencies]
rand = "0.8"

[features]
all-one-shot = []
16 changes: 16 additions & 0 deletions src/mutex/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#[cfg(not(feature = "all-one-shot"))]
pub(crate) mod spin;
#[cfg(feature = "all-one-shot")]
pub(crate) mod spin {
pub use one_shot_mutex::{
OneShotMutex as SpinMutex, OneShotMutexGuard as SpinMutexGuard,
RawOneShotMutex as RawSpinMutex,
};
}
#[cfg(not(feature = "all-one-shot"))]
pub(crate) mod ticket;
#[cfg(feature = "all-one-shot")]
pub(crate) mod ticket {
pub use one_shot_mutex::{
OneShotMutex as TicketMutex, OneShotMutexGuard as TicketMutexGuard,
RawOneShotMutex as RawTicketMutex,
};
}

use interrupt_mutex::RawInterruptMutex;
use one_shot_mutex::RawOneShotMutex;
Expand Down

0 comments on commit 2763e5d

Please sign in to comment.