diff --git a/Sources/NIOConcurrencyHelpers/NIOLock.swift b/Sources/NIOConcurrencyHelpers/NIOLock.swift index 3f1c9f6df..3c70d604a 100644 --- a/Sources/NIOConcurrencyHelpers/NIOLock.swift +++ b/Sources/NIOConcurrencyHelpers/NIOLock.swift @@ -140,6 +140,12 @@ extension NIOLock { } return try body() } + + // specialise Void return (for performance) + @inlinable + public func withLockVoid(_ body: () throws -> Void) rethrows -> Void { + try self.withLock(body) + } } #if compiler(>=5.5) && canImport(_Concurrency)