DnsUpdater/Sources/App/Util/Wait.swift
Christoph Hagen 9b6fd627ac First version
2024-11-15 10:46:29 +01:00

11 lines
217 B
Swift

import Foundation
func wait(for block: @escaping @Sendable () async -> Void) {
let semaphore = DispatchSemaphore(value: 0)
Task {
await block()
semaphore.signal()
}
semaphore.wait()
}