Skip to content

[Freestanding] Disable checked continuations. #60790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 31, 2022

Conversation

nate-chandler
Copy link
Contributor

In the task-to-thread model, there are no threading mechanisms by which work could be offloaded onto another thread. As such, callback based asynchronous APIs which are not Swift async do not make sense.

rdar://99047747

In the task-to-thread model, there are no threading mechanisms by which
work could be offloaded onto another thread.  As such, callback based
asynchronous APIs which are not Swift async do not make sense.

rdar://99047747
@nate-chandler
Copy link
Contributor Author

preset=stdlib_S_standalone_minimal_macho_x86_64,build,test
@swift-ci please test with toolchain and preset

@@ -296,4 +299,65 @@ public func withCheckedThrowingContinuation<T>(
body(CheckedContinuation(continuation: $0, function: function))
}
}
#else
Copy link
Collaborator

@theblixguy theblixguy Aug 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered using SE-0367? I think using that you can conditionally add the available attribute on the main declaration and avoid having to duplicate it.

So for example just above main declaration public struct CheckedContinuation, you can add:

#if SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
  @available(*, unavailable, message: "Unavailable in task-to-thread concurrency model")
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation also changes.

@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

@swift-ci please test windows platform

@nate-chandler nate-chandler merged commit 1f38c4b into swiftlang:main Aug 31, 2022
@nate-chandler nate-chandler deleted the rdar99047747 branch July 5, 2023 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants