all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox 03/12] async: remove lazy_static dependency
Date: Tue, 13 Aug 2024 12:57:00 +0200	[thread overview]
Message-ID: <20240813105709.320119-3-m.sandoval@proxmox.com> (raw)
In-Reply-To: <20240813105709.320119-1-m.sandoval@proxmox.com>

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 proxmox-async/Cargo.toml     |  2 +-
 proxmox-async/debian/control |  2 --
 proxmox-async/src/runtime.rs | 11 ++++-------
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/proxmox-async/Cargo.toml b/proxmox-async/Cargo.toml
index 669ae08b..8508ef5d 100644
--- a/proxmox-async/Cargo.toml
+++ b/proxmox-async/Cargo.toml
@@ -6,13 +6,13 @@ edition.workspace = true
 license.workspace = true
 repository.workspace = true
 description = "Proxmox async/tokio helpers"
+rust-version.workspace = true
 
 exclude.workspace = true
 
 [dependencies]
 anyhow.workspace = true
 futures.workspace = true
-lazy_static.workspace = true
 pin-utils.workspace = true
 tokio = { workspace = true, features = [ "net", "rt", "rt-multi-thread", "sync"] }
 
diff --git a/proxmox-async/debian/control b/proxmox-async/debian/control
index 517244bd..da937ed9 100644
--- a/proxmox-async/debian/control
+++ b/proxmox-async/debian/control
@@ -8,7 +8,6 @@ Build-Depends: debhelper (>= 12),
  libstd-rust-dev <!nocheck>,
  librust-anyhow-1+default-dev <!nocheck>,
  librust-futures-0.3+default-dev <!nocheck>,
- librust-lazy-static-1+default-dev (>= 1.4-~~) <!nocheck>,
  librust-pin-utils-0.1+default-dev <!nocheck>,
  librust-proxmox-io-1+default-dev (>= 1.1.0-~~) <!nocheck>,
  librust-proxmox-io-1+tokio-dev (>= 1.1.0-~~) <!nocheck>,
@@ -34,7 +33,6 @@ Depends:
  ${misc:Depends},
  librust-anyhow-1+default-dev,
  librust-futures-0.3+default-dev,
- librust-lazy-static-1+default-dev (>= 1.4-~~),
  librust-pin-utils-0.1+default-dev,
  librust-proxmox-io-1+default-dev (>= 1.1.0-~~),
  librust-proxmox-io-1+tokio-dev (>= 1.1.0-~~),
diff --git a/proxmox-async/src/runtime.rs b/proxmox-async/src/runtime.rs
index efc1cd88..0721fd9e 100644
--- a/proxmox-async/src/runtime.rs
+++ b/proxmox-async/src/runtime.rs
@@ -33,19 +33,16 @@
 //! [openssl-bug]: https://github.com/openssl/openssl/issues/6214
 
 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::thread::{self, Thread};
 
-use lazy_static::lazy_static;
 use pin_utils::pin_mut;
 use tokio::runtime::{self, Runtime, RuntimeFlavor};
 
-lazy_static! {
-    // avoid openssl bug: https://github.com/openssl/openssl/issues/6214
-    // by dropping the runtime as early as possible
-    static ref RUNTIME: Mutex<Weak<Runtime>> = Mutex::new(Weak::new());
-}
+// avoid openssl bug: https://github.com/openssl/openssl/issues/6214
+// by dropping the runtime as early as possible
+static RUNTIME: LazyLock<Mutex<Weak<Runtime>>> = LazyLock::new(|| Mutex::new(Weak::new()));
 
 #[link(name = "crypto")]
 extern "C" {
-- 
2.39.2



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


  parent reply	other threads:[~2024-08-13 10:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13 10:56 [pbs-devel] [PATCH proxmox 01/12] cargo: set msrv to 1.80 Maximiliano Sandoval
2024-08-13 10:56 ` [pbs-devel] [PATCH proxmox 02/12] dns-api: remove lazy-static dependency Maximiliano Sandoval
2024-08-13 10:57 ` Maximiliano Sandoval [this message]
2024-08-13 10:57 ` [pbs-devel] [PATCH proxmox 04/12] subscription: remove lazy_static dependency Maximiliano Sandoval
2024-08-13 10:57 ` [pbs-devel] [PATCH proxmox 05/12] rest-server: " Maximiliano Sandoval
2024-08-13 10:57 ` [pbs-devel] [PATCH proxmox 06/12] time: " Maximiliano Sandoval
2024-08-13 10:57 ` [pbs-devel] [PATCH proxmox 07/12] sys: " Maximiliano Sandoval
2024-08-13 10:57 ` [pbs-devel] [PATCH proxmox 08/12] network-api: " Maximiliano Sandoval
2024-08-13 10:57 ` [pbs-devel] [PATCH proxmox 09/12] auth-api: " Maximiliano Sandoval
2024-08-13 10:57 ` [pbs-devel] [PATCH proxmox 10/12] acme-api: " Maximiliano Sandoval
2024-08-13 10:57 ` [pbs-devel] [PATCH proxmox 11/12] schema: " Maximiliano Sandoval
2024-08-13 10:57 ` [pbs-devel] [PATCH proxmox 12/12] cargo: remove lazy_static dependency on workspace Maximiliano Sandoval

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240813105709.320119-3-m.sandoval@proxmox.com \
    --to=m.sandoval@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal