-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(maitake): introduce a separate
maitake-sync
crate (#462)
The `maitake` crate provides async synchronization primitives in a `maitake::sync` module. These APIs don't require the rest of the runtime, and would be nice to be able to use in other crates. `maitake` is not yet published to crates.io, as it contains Git-only dependencies. However, the `sync` module can be implemented entirely using published code, and therefore, a crate containing only `maitake::sync` could be published. This branch introduces a new `maitake-sync` crate, containing the synchronization primitives from `maitake::sync`. The `maitake::sync` module now re-exports `maitake-sync`, so there should be no impact for existing uses of the crate. The new `maitake-sync` crate can easily be published to crates.io, and depended on from released code.
- Loading branch information
Showing
49 changed files
with
2,740 additions
and
765 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ members = [ | |
"hal-x86_64", | ||
"inoculate", | ||
"maitake", | ||
"maitake-sync", | ||
"mycotest", | ||
"trace", | ||
"pci", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[package] | ||
name = "maitake-sync" | ||
version = "0.1.0" | ||
authors = [ | ||
"Eliza Weisman <[email protected]>", | ||
] | ||
description = "No-std async synchronization primitives from Maitake" | ||
repository = "https://github.com/hawkw/mycelium" | ||
documentation = "https://docs.rs/maitake-sync" | ||
homepage = "https://mycelium.elizas.website" | ||
license = "MIT" | ||
readme = "README.md" | ||
keywords = ["async", "no_std", "sync", "mutex", "rwlock"] | ||
categories = [ | ||
"no-std", | ||
"async", | ||
"concurrency" | ||
] | ||
edition = "2021" | ||
rust-version = "1.61.0" | ||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[features] | ||
default = ["alloc"] | ||
alloc = ["cordyceps/alloc"] | ||
no-cache-pad = ["cordyceps/no-cache-pad"] | ||
core-error = [] | ||
|
||
[dependencies] | ||
mycelium-bitfield = { version = "0.1.3", path = "../bitfield" } | ||
cordyceps = { version = "0.3.0", path = "../cordyceps" } | ||
pin-project = "1" | ||
portable-atomic = "1.2" | ||
tracing = { version = "0.1", default_features = false, optional = true } | ||
|
||
# this is a normal dependency, rather than a dev dependency, so that | ||
# `maitake-sync` may be used in other crates' loom tests as well (but only when | ||
# the cfg is enabled). | ||
[target.'cfg(loom)'.dependencies] | ||
loom = { version = "0.7", default_features = false } | ||
|
||
[dev-dependencies] | ||
futures-util = "0.3" | ||
futures = "0.3" | ||
tokio-test = "0.4" | ||
tracing = { version = "0.1", default_features = false, features = ["std"] } | ||
tracing-subscriber = { version = "0.3.11", features = ["fmt", "env-filter"] } | ||
|
||
[target.'cfg(not(loom))'.dev-dependencies] | ||
proptest = "1" | ||
tokio = { version = "1.32", features = ["rt", "macros"] } | ||
|
||
[target.'cfg(loom)'.dev-dependencies] | ||
loom = { version = "0.7", features = ["futures", "checkpoint"] } | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
rustdoc-args = ["--cfg", "docsrs"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Eliza Weisman | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.