Files
swift-mirror/stdlib/public/Concurrency/PartialAsyncTask.swift
Joe Groff a664a33b52 SIL: Add instructions to represent async suspend points.
`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.
2020-10-01 14:21:52 -07:00

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) { }
}