Skip to content

Commit 1ed5181

Browse files
authored
Make sure that the once used for Process is static, so not recreated for each setup (#5038)
1 parent aa5c175 commit 1ed5181

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: Sources/Foundation/Process.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ private func quoteWindowsCommandLine(_ commandLine: [String]) -> String {
226226
#endif
227227

228228
open class Process: NSObject, @unchecked Sendable {
229+
static let once = Mutex(false)
230+
229231
private static func setup() {
230-
let once = Mutex(false)
231-
232232
once.withLock {
233233
if !$0 {
234234
let thread = Thread {

0 commit comments

Comments
 (0)