add withLockVoid(_:) to NIOLock (#2276)

This commit is contained in:
Mahdi Bahrami authored and GitHub committed 2022-10-04 02:59:27 -07:00
1 parent 560e360017
commit e9eeaadf11
1 file changed
+6
@@ -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)