mirror of
https://github.com/apple/container.git
synced 2026-09-13 19:25:47 +00:00
Source code documentation updates (#9)
This change adds documentation to quite a few existing public types that didn't have a blurb before. Additionally, this fixes a couple things that I think either didn't make sense when going to document them: - Rename ConnectionStream to VsockConnectionStream. This type only functions for vsock connections. - Deletes NsLock+Closure. This was not used anywhere. - Rename ContainerizationOCI/Config.swift to ImageConfig.swift. Signed-off-by: Danny Canter <danny_canter@apple.com>
This commit is contained in:
@@ -16,6 +16,10 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
/// `AsyncLock` provides a familiar locking API, with the main benefit being that it
|
||||
/// is safe to call async methods while holding the lock. This is primarily used in spots
|
||||
/// where an actor makes sense, but we may need to ensure we don't fall victim to actor
|
||||
/// reentrancy issues.
|
||||
public actor AsyncLock {
|
||||
private var busy = false
|
||||
private var queue: ArraySlice<CheckedContinuation<(), Never>> = []
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
/// `Timeout` contains helpers to run an operation and error out if
|
||||
/// the operation does not finish within a provided time.
|
||||
public struct Timeout {
|
||||
/// Performs the passed in `operation` and throws a `CancellationError` if the operation
|
||||
/// doesn't finish in the provided `seconds` amount.
|
||||
public static func run<T: Sendable>(
|
||||
seconds: UInt32,
|
||||
operation: @escaping @Sendable () async -> T
|
||||
|
||||
Reference in New Issue
Block a user