Files
swiftpm-mustache/Sources/Mustache/NSLock+Backport.swift
T. R. Bernstein 6061715025
Some checks failed
CI / macOS (push) Has been cancelled
CI / linux (swift:6.0) (push) Has been cancelled
CI / linux (swift:6.1) (push) Has been cancelled
CI / linux (swift:6.2) (push) Has been cancelled
CI / windows (6.1) (push) Has been cancelled
Adapt project for Astzweig
2025-09-29 15:03:48 +02:00

14 lines
253 B
Swift

#if compiler(<6.0)
import Foundation
extension NSLock {
func withLock<Value>(_ operation: () throws -> Value) rethrows -> Value {
self.lock()
defer {
self.unlock()
}
return try operation()
}
}
#endif