Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions litebox/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ windows-sys = { version = "0.60.2", features = [

[features]
lock_tracing = ["dep:arrayvec", "spin/mutex"]
trace_fs = []
panic_on_unclosed_fd_drop = []
enforce_singleton_litebox_instance = []

Expand Down
22 changes: 20 additions & 2 deletions litebox/src/sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,33 @@ pub use rwlock::{
MappedRwLockReadGuard, MappedRwLockWriteGuard, RwLock, RwLockReadGuard, RwLockWriteGuard,
};

#[cfg(not(feature = "lock_tracing"))]
#[cfg(not(any(feature = "lock_tracing", feature = "trace_fs")))]
/// A convenience name for specific requirements from the platform
pub trait RawSyncPrimitivesProvider: platform::RawMutexProvider + Sync + 'static {}
#[cfg(not(feature = "lock_tracing"))]
#[cfg(not(any(feature = "lock_tracing", feature = "trace_fs")))]
impl<Platform> RawSyncPrimitivesProvider for Platform where
Platform: platform::RawMutexProvider + Sync + 'static
{
}

// When `trace_fs` is enabled, filesystem tracing code logs through
// `DebugLogProvider`. Since the platform type is threaded through
// `RawSyncPrimitivesProvider` in fs-related contexts, the bound is added here
// so it is available wherever the platform is used. `lock_tracing` already
// includes `DebugLogProvider`, so this branch only applies when `trace_fs` is
// enabled without `lock_tracing`.
#[cfg(all(feature = "trace_fs", not(feature = "lock_tracing")))]
/// A convenience name for specific requirements from the platform
pub trait RawSyncPrimitivesProvider:
platform::RawMutexProvider + platform::DebugLogProvider + Sync + 'static
{
}
#[cfg(all(feature = "trace_fs", not(feature = "lock_tracing")))]
impl<Platform> RawSyncPrimitivesProvider for Platform where
Platform: platform::RawMutexProvider + platform::DebugLogProvider + Sync + 'static
{
}

#[cfg(feature = "lock_tracing")]
/// A convenience name for specific requirements from the platform
pub trait RawSyncPrimitivesProvider:
Expand Down
Loading