mirror of
https://github.com/apple/swift-nio
synced 2026-11-25 04:47:49 +00:00
add withLockVoid(_:) to NIOLock (#2276)
This commit is contained in:
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)
|
||||
|
||||
Reference in new issue
Block a user