File tree 3 files changed +19
-1
lines changed
3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change
1
+ //! Scoped Mutex Traits
2
+ //!
3
+ //! This crate provides traits that are aimed at compatibility for scoped mutexes.
4
+ //!
5
+ //! Compared to the more general traits provided by the [`lock_api`] crate, these traits
6
+ //! are aimed at being more compatible with implementations based on critical sections,
7
+ //! are easier to work with in a nested or strictly LIFO pattern.
8
+ //!
9
+ //! [`lock_api`]: https://docs.rs/lock_api/
10
+ #![ deny( missing_docs) ]
1
11
#![ cfg_attr( not( feature = "std" ) , no_std) ]
2
12
13
+ /// Const Init Trait
14
+ ///
15
+ /// This trait is intended for use when implementers of [`ScopedRawMutex`] that can
16
+ /// be constructed in const context, e.g. for placing in a `static`
3
17
pub trait ConstInit {
4
18
/// Create a new instance.
5
19
///
Original file line number Diff line number Diff line change 1
1
//! Scoped Mutex Crate
2
-
2
+ #! [ deny ( missing_docs ) ]
3
3
#![ cfg_attr( not( feature = "std" ) , no_std) ]
4
4
5
5
pub mod raw_impls;
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ use scoped_mutex_traits::{ConstInit, ScopedRawMutex};
13
13
14
14
#[ cfg( feature = "impl-critical-section" ) ]
15
15
pub mod cs {
16
+ //! Critical Section based implementation
16
17
17
18
use super :: * ;
18
19
@@ -74,6 +75,7 @@ pub mod cs {
74
75
// ================
75
76
76
77
pub mod local {
78
+ //! Locally usable based implementation
77
79
use super :: * ;
78
80
79
81
/// A mutex that allows borrowing data in local context.
@@ -135,6 +137,8 @@ pub mod local {
135
137
136
138
#[ cfg( all( feature = "impl-unsafe-cortex-m-single-core" , cortex_m) ) ]
137
139
pub mod single_core_thread_mode {
140
+ //! A single-core safe implementation that does not require a critical section
141
+
138
142
use super :: * ;
139
143
140
144
/// A "mutex" that only allows borrowing from thread mode.
You can’t perform that action at this time.
0 commit comments