mirror of https://github.com/smol-rs/async-lock
Compare commits
4 Commits
0442a5587e
...
f2a37b313e
Author | SHA1 | Date |
---|---|---|
John Nunley | f2a37b313e | |
John Nunley | 7f219713c6 | |
John Nunley | 50ccff79c1 | |
John Nunley | db0742bd8f |
|
@ -5,8 +5,8 @@ name = "async-lock"
|
|||
# - Create "v3.x.y" git tag
|
||||
version = "3.3.0"
|
||||
authors = ["Stjepan Glavina <stjepang@gmail.com>"]
|
||||
edition = "2018"
|
||||
rust-version = "1.61"
|
||||
edition = "2021"
|
||||
rust-version = "1.60"
|
||||
description = "Async synchronization primitives"
|
||||
license = "Apache-2.0 OR MIT"
|
||||
repository = "https://github.com/smol-rs/async-lock"
|
||||
|
@ -24,13 +24,10 @@ default = ["std"]
|
|||
std = ["event-listener/std", "event-listener-strategy/std"]
|
||||
|
||||
[dev-dependencies]
|
||||
async-channel = "2.1.1"
|
||||
async-channel = "2.2.0"
|
||||
fastrand = "2.0.0"
|
||||
futures-lite = "2.0.0"
|
||||
waker-fn = "1.1.0"
|
||||
|
||||
[target.'cfg(target_family = "wasm")'.dev-dependencies]
|
||||
wasm-bindgen-test = "0.3"
|
||||
|
||||
[patch.crates-io]
|
||||
async-channel = { git = "https://github.com/smol-rs/async-channel.git", branch = "notgull/evl5" }
|
||||
|
|
|
@ -502,10 +502,11 @@ impl<T> OnceCell<T> {
|
|||
/// ```
|
||||
#[cfg(all(feature = "std", not(target_family = "wasm")))]
|
||||
pub fn get_or_init_blocking(&self, closure: impl FnOnce() -> T + Unpin) -> &T {
|
||||
match self.get_or_try_init_blocking(move || {
|
||||
let result = self.get_or_try_init_blocking(move || {
|
||||
let result: Result<T, Infallible> = Ok(closure());
|
||||
result
|
||||
}) {
|
||||
});
|
||||
match result {
|
||||
Ok(value) => value,
|
||||
Err(infallible) => match infallible {},
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ fn smoke() {
|
|||
|
||||
#[cfg(all(feature = "std", not(target_family = "wasm")))]
|
||||
#[test]
|
||||
#[cfg_attr(miri, ignore)]
|
||||
fn smoke_blocking() {
|
||||
future::block_on(async move {
|
||||
const N: usize = 10;
|
||||
|
|
Loading…
Reference in New Issue