From 3141d465af13a0c8e88b39fd6edcb37e2bc0f123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Wed, 8 Mar 2023 14:31:29 +0100 Subject: [PATCH] Add all-still feature --- Cargo.toml | 3 +++ src/mutex/mod.rs | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index fbca4b9..a28470e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,3 +23,6 @@ tock-registers = { version = "0.8", default-features = false } [dev-dependencies] rand = "0.8" + +[features] +all-still = [] diff --git a/src/mutex/mod.rs b/src/mutex/mod.rs index c658370..8a16ea5 100644 --- a/src/mutex/mod.rs +++ b/src/mutex/mod.rs @@ -1,7 +1,22 @@ pub(crate) mod interrupt; +#[cfg(not(feature = "all-still"))] pub(crate) mod spin; +#[cfg(feature = "all-still")] +pub(crate) mod spin { + pub use super::still::{ + RawStillMutex as RawSpinMutex, StillMutex as SpinMutex, StillMutexGuard as SpinMutexGuard, + }; +} pub(crate) mod still; +#[cfg(not(feature = "all-still"))] pub(crate) mod ticket; +#[cfg(feature = "all-still")] +pub(crate) mod ticket { + pub use super::still::{ + RawStillMutex as RawTicketMutex, StillMutex as TicketMutex, + StillMutexGuard as TicketMutexGuard, + }; +} use interrupt::RawInterruptMutex; use spin::RawSpinMutex;