From 357915c48d75db643bd4eac5700d54d5410dd26f Mon Sep 17 00:00:00 2001 From: Tony Parker Date: Tue, 30 Jul 2024 11:48:12 -0700 Subject: [PATCH] Make sure that the once used for Process is static, so not recreated for each setup --- Sources/Foundation/Process.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Foundation/Process.swift b/Sources/Foundation/Process.swift index 7a49932004..ee35c23a33 100644 --- a/Sources/Foundation/Process.swift +++ b/Sources/Foundation/Process.swift @@ -226,9 +226,9 @@ private func quoteWindowsCommandLine(_ commandLine: [String]) -> String { #endif open class Process: NSObject, @unchecked Sendable { + static let once = Mutex(false) + private static func setup() { - let once = Mutex(false) - once.withLock { if !$0 { let thread = Thread {