Skip to content

Commit 42168ed

Browse files
committed
feat(sync): use bindings to provide a content storage for r3::sync::RecursiveMutex
1 parent 9395efa commit 42168ed

File tree

8 files changed

+213
-59
lines changed

8 files changed

+213
-59
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/r3/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ While much of the application-level API has retained its general shape, there ar
1818
- `r3::kernel::ResultCode::BadId` was renamed to `NoAccess` and covers general protection failures detected by a now-optional protection mechanism. This means that application and library code can't rely on `NoAccess` being returned reliably anymore (it can't anyway once owned handles are implemented), and that a kernel implementation may use this error code to indicate that a given kernel object ID might be valid, but the caller lacks the necessary privileges to access that object.
1919
- The `chrono` Cargo feature was renamed to `chrono_0p4`.
2020
- `r3::sync` is now gated by `cfg(feature = "sync")`.
21-
- `r3::sync::Mutex` is now backed by bindings (`Bind`). The default value is now `<T as Default>::default()` instead of `<T as Init>::INIT`. Additional options are available, which means you no longer have to implement `Init` just to put a custom type in `Mutex`, and that each `Mutex` can have a distinct initial value.
21+
- `r3::sync::{Mutex, RecursiveMutex}` is now backed by bindings (`Bind`). The default value is now `<T as Default>::default()` instead of `<T as Init>::INIT`. Additional options are available, which means you no longer have to implement `Init` just to put a custom type in `Mutex`, and that each `Mutex` can have a distinct initial value.
2222

2323
TODO
2424

src/r3/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ _full = []
2929
stable_deref_trait = { version = "1.2.0", default-features = false }
3030
embed-doc-image = { version = "0.1.4", optional = true }
3131
svgbobdoc = { version = "0.3.0-alpha.4" }
32+
macropol = { version = "0.1.2" }
3233
r3_core = { version = "0.1.0", path = "../r3_core" }
3334

3435
[dev-dependencies]

src/r3/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
#![feature(type_changing_struct_update)]
33
#![feature(const_precise_live_drops)]
44
#![feature(const_fn_fn_ptr_basics)]
5+
#![feature(type_alias_impl_trait)]
56
#![feature(const_fn_trait_bound)]
7+
#![feature(const_impl_trait)]
68
#![feature(const_trait_impl)]
79
#![feature(const_mut_refs)]
810
#![feature(cell_update)]

src/r3/src/sync/mutex.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use crate::{
1717
};
1818

1919
/// The definer (static builder) for [`StaticMutex`][].
20+
#[doc = include_str!("../common.md")]
2021
pub struct Definer<System, Source> {
2122
mutex: mutex::MutexDefiner<System>,
2223
source: Source,
@@ -258,7 +259,10 @@ where
258259
}
259260

260261
// Define methods to set `Definer::source`
261-
impl_source_setter!(impl Definer<System, #Source>);
262+
impl_source_setter!(
263+
#[no_autowrap()]
264+
impl Definer<System, #Source>
265+
);
262266

263267
/// # Finalization
264268
///

0 commit comments

Comments
 (0)