-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Use VoidTaskResult for void returns in runtime async
#122285
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
Conversation
Removes some abstraction and unifies behavior with async 1, at the cost of slightly larger instances for void methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR simplifies the runtime async implementation by removing an abstraction layer and unifying the handling of void-returning async methods with other async methods. The change uses VoidTaskResult as a concrete type parameter instead of maintaining a separate non-generic task implementation.
Key Changes:
- Removed the
IRuntimeAsyncTaskOps<T>interface and its implementations, eliminating unnecessary abstraction - Consolidated
RuntimeAsyncTask(non-generic) andRuntimeAsyncTask<T>into a single generic class by usingVoidTaskResultfor void methods - Converted static generic operations to instance methods for simpler and more direct code
|
Tagging subscribers to this area: @dotnet/area-system-threading-tasks |
src/coreclr/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.CoreCLR.cs
Show resolved
Hide resolved
|
Very nice simplification! Looks fairly straightforward too. Just had a question about |
Removes some abstraction and unifies behavior with async 1 at the cost of these rarely created tasks being slightly larger for void methods.
Fix #122235