From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 927FE1FF16B for ; Wed, 14 Aug 2024 09:20:21 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7CD3CFDAE; Wed, 14 Aug 2024 09:20:36 +0200 (CEST) From: Maximiliano Sandoval To: pbs-devel@lists.proxmox.com Date: Wed, 14 Aug 2024 09:19:52 +0200 Message-Id: <20240814072001.53422-3-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240814072001.53422-1-m.sandoval@proxmox.com> References: <20240814072001.53422-1-m.sandoval@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.111 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [runtime.rs] Subject: [pbs-devel] [PATCH proxmox v2 03/12] async: remove lazy_static dependency X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" Signed-off-by: Maximiliano Sandoval --- proxmox-async/Cargo.toml | 2 +- proxmox-async/src/runtime.rs | 11 ++++------- 2 files changed, 5 insertions(+), 8 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/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> = 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>> = 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