-
Notifications
You must be signed in to change notification settings - Fork 253
Closed
Description
Sources/ArgumentParser/Utilities/Mutex.swift:53:5: warning: [ValidateDocumentationComments] remove the 'Throws:' sections of 'withLock'; it does not throw any errors
/// Calls the given closure after acquiring the lock and then releases
/// ownership.
///
/// - Warning: Recursive calls to `withLock` within the closure parameter has
/// behavior that is platform dependent. Some platforms may choose to panic
/// the process, deadlock, or leave this behavior unspecified. This will
/// never reacquire the lock however.
///
/// - Parameter body: A closure with a parameter of `Value` that has exclusive
/// access to the value being stored within this mutex. This closure is
/// considered the critical section as it will only be executed once the
/// calling thread has acquired the lock.
///
/// - Throws: Re-throws any error thrown by `body`.
///
/// - Returns: The return value, if any, of the `body` closure parameter.
func withLock<U>(
_ body: (inout T) throws -> U
) rethrows -> U {
self.lock.lock()
defer { self.lock.unlock() }
return try body(&self.value)
}Metadata
Metadata
Assignees
Labels
No labels