mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
`get_async_continuation[_addr]` begins a suspend operation by accessing the continuation value that can resume the task, which can then be used in a callback or event handler before executing `await_async_continuation` to suspend the task.
37 lines
967 B
Swift
37 lines
967 B
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2020 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
import Swift
|
|
@_implementationOnly import _SwiftConcurrencyShims
|
|
|
|
public struct PartialAsyncTask {
|
|
private var context: UnsafeMutablePointer<_SwiftContext>
|
|
|
|
public func run() { }
|
|
}
|
|
|
|
|
|
public struct UnsafeContinuation<T> {
|
|
private var context: UnsafeRawPointer
|
|
|
|
public func resume(_: T) { }
|
|
}
|
|
|
|
public struct UnsafeThrowingContinuation<T> {
|
|
private var context: UnsafeRawPointer
|
|
|
|
public func resume(_: T) { }
|
|
public func fail(_: Error) { }
|
|
}
|
|
|
|
|