mirror of
https://git.proxmox.com/git/proxmox
synced 2025-10-04 13:53:54 +00:00
async: remove lazy_static dependency
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
This commit is contained in:
parent
9693ceca7a
commit
6c0f6890e4
@ -6,13 +6,13 @@ edition.workspace = true
|
|||||||
license.workspace = true
|
license.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
description = "Proxmox async/tokio helpers"
|
description = "Proxmox async/tokio helpers"
|
||||||
|
rust-version.workspace = true
|
||||||
|
|
||||||
exclude.workspace = true
|
exclude.workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
futures.workspace = true
|
futures.workspace = true
|
||||||
lazy_static.workspace = true
|
|
||||||
pin-utils.workspace = true
|
pin-utils.workspace = true
|
||||||
tokio = { workspace = true, features = [ "net", "rt", "rt-multi-thread", "sync"] }
|
tokio = { workspace = true, features = [ "net", "rt", "rt-multi-thread", "sync"] }
|
||||||
|
|
||||||
|
@ -33,19 +33,16 @@
|
|||||||
//! [openssl-bug]: https://github.com/openssl/openssl/issues/6214
|
//! [openssl-bug]: https://github.com/openssl/openssl/issues/6214
|
||||||
|
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
use std::sync::{Arc, Mutex, Weak};
|
use std::sync::{Arc, LazyLock, Mutex, Weak};
|
||||||
use std::task::{Context, Poll, Waker};
|
use std::task::{Context, Poll, Waker};
|
||||||
use std::thread::{self, Thread};
|
use std::thread::{self, Thread};
|
||||||
|
|
||||||
use lazy_static::lazy_static;
|
|
||||||
use pin_utils::pin_mut;
|
use pin_utils::pin_mut;
|
||||||
use tokio::runtime::{self, Runtime, RuntimeFlavor};
|
use tokio::runtime::{self, Runtime, RuntimeFlavor};
|
||||||
|
|
||||||
lazy_static! {
|
// avoid openssl bug: https://github.com/openssl/openssl/issues/6214
|
||||||
// avoid openssl bug: https://github.com/openssl/openssl/issues/6214
|
// by dropping the runtime as early as possible
|
||||||
// by dropping the runtime as early as possible
|
static RUNTIME: LazyLock<Mutex<Weak<Runtime>>> = LazyLock::new(|| Mutex::new(Weak::new()));
|
||||||
static ref RUNTIME: Mutex<Weak<Runtime>> = Mutex::new(Weak::new());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[link(name = "crypto")]
|
#[link(name = "crypto")]
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
Loading…
Reference in New Issue
Block a user