portable-atomic-util
Synchronization primitives built with portable-atomic.
- Provide
Arc
. (optional, requires thestd
oralloc
feature) - Provide
task::Wake
. (optional, requires thestd
oralloc
feature)
See #1 for other primitives being considered for addition to this crate.
Optional features
-
std
Usestd
.Note:
- This implicitly enables the
alloc
feature.
- This implicitly enables the
-
alloc
Usealloc
.Note:
- The MSRV when this feature is enabled and the
std
feature is not enabled is Rust 1.36 thatalloc
crate stabilized.
- The MSRV when this feature is enabled and the
Optional cfg
One of the ways to enable cfg is to set rustflags in the cargo config:
# .cargo/config.toml
[<target>]
= ["--cfg", "portable_atomic_unstable_coerce_unsized"]
Or set environment variable:
RUSTFLAGS="--cfg portable_atomic_unstable_coerce_unsized"
-
--cfg portable_atomic_unstable_coerce_unsized
Support coercing ofArc<T>
toArc<U>
as instd::sync::Arc
.This cfg requires Rust nightly because this coercing requires unstable
CoerceUnsized
trait.See this issue comment for another known workaround.
Note: This cfg is unstable and outside of the normal semver guarantees and minor or patch versions of portable-atomic-util may make breaking changes to them at any time.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.