We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
withLock
1 parent f2bf7d5 commit 71fc550Copy full SHA for 71fc550
Sources/Basics/Concurrency/NSLock+Extensions.swift
@@ -14,7 +14,7 @@ import class Foundation.NSLock
14
15
extension NSLock {
16
/// Execute the given block while holding the lock.
17
- public func withLock<T>(_ body: () throws -> T) rethrows -> T {
+ @discardableResult public func withLock<T>(_ body: () throws -> T) rethrows -> T {
18
lock()
19
defer { unlock() }
20
return try body()
0 commit comments