Skip to content

Commit de055b6

Browse files
authored
Bump mutex crate version (#14)
* Bump version * Improve the readmes
1 parent b7165f7 commit de055b6

File tree

5 files changed

+42
-4
lines changed

5 files changed

+42
-4
lines changed

Cargo.lock

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

source/mutex-traits/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ Compared to the more general traits provided by the [`lock_api`] crate, these
2323
traits are aimed at being more compatible with implementations based on
2424
critical sections, are easier to work with in a nested or strictly LIFO pattern.
2525

26+
## Versioning, and which crate to use?
27+
28+
The [`mutex-traits`] crate should be used by **library crates** that want to be generic
29+
over different ways of exclusive access.
30+
31+
The [`mutex`] crate should be used by **applications** that need to select which implementation
32+
is appropriate for their use case. The [`mutex`] crate also re-exports the [`mutex-traits`]
33+
crate for convenience, so applications only need to pull in one direct dependency.
34+
35+
While both crates are >= 1.0, it should be expected that it is **MUCH** more likely that [`mutex`]
36+
crate will make breaking changes someday. The hope is that [`mutex-traits`] NEVER releases a 2.0
37+
version, which means that even if there are 1.x, 2.x, 3.x, etc. versions of the [`mutex`] crate,
38+
they all can be used interchangably since they implement the 1.x [`mutex-traits`] interfaces.
39+
40+
If you are a library crate, consider ONLY relying on the [`mutex-traits`] crate directly, and
41+
put any use of the [`mutex`] crate behind a feature flag or in the `dev-dependencies` section.
42+
2643
## Provenance
2744

2845
Portions of this code are forked from the `embassy-sync` crate.
@@ -46,4 +63,6 @@ Unless you explicitly state otherwise, any contribution intentionally submitted
4663
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
4764
dual licensed as above, without any additional terms or conditions.
4865

66+
[`mutex`]: https://crates.io/crates/mutex
67+
[`mutex-traits`]: https://crates.io/crates/mutex-traits
4968
[`lock_api`]: https://docs.rs/lock_api/

source/mutex/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mutex"
3-
version = "0.1.0"
3+
version = "1.0.0"
44
description = "An abstraction over closure-based mutexes"
55
categories = [
66
"embedded",

source/mutex/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@
1919

2020
Mutex implementations using [`mutex-traits`].
2121

22+
## Versioning, and which crate to use?
23+
24+
The [`mutex-traits`] crate should be used by **library crates** that want to be generic
25+
over different ways of exclusive access.
26+
27+
The [`mutex`] crate should be used by **applications** that need to select which implementation
28+
is appropriate for their use case. The [`mutex`] crate also re-exports the [`mutex-traits`]
29+
crate for convenience, so applications only need to pull in one direct dependency.
30+
31+
While both crates are >= 1.0, it should be expected that it is more likely that [`mutex`] crate
32+
will make breaking changes someday. The hope is that [`mutex-traits`] NEVER releases a 2.0
33+
version, which means that even if there are 1.x, 2.x, 3.x, etc. versions of the [`mutex`] crate,
34+
they all can be used interchangably since they implement the 1.x [`mutex-traits`] interfaces.
35+
36+
If you are a library crate, consider ONLY relying on the [`mutex-traits`] crate directly, and
37+
put any use of the [`mutex`] crate behind a feature flag or in the `dev-dependencies` section.
38+
2239
## Crate Feature Flags
2340

2441
The following feature flags enable implementations of
@@ -49,6 +66,7 @@ functionality other than implementations of [`ScopedRawMutex`]/[`RawMutex`]:
4966
by embedded projects and other use-cases where minimizing binary size is
5067
important.
5168

69+
[`mutex`]: https://crates.io/crates/mutex
5270
[`mutex-traits`]: https://crates.io/crates/mutex-traits
5371
[`critical-section`]: https://crates.io/crates/critical-section
5472
[`lock_api`]: https://crates.io/crates/critical-section

source/mutex/src/raw_impls.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010

1111
use core::marker::PhantomData;
1212
use core::sync::atomic::{AtomicBool, Ordering};
13-
1413
use mutex_traits::{ConstInit, ScopedRawMutex};
1514

15+
pub use mutex_traits as traits;
16+
1617
#[cfg(feature = "impl-critical-section")]
1718
pub mod cs {
1819
//! Critical Section based implementation

0 commit comments

Comments
 (0)