-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Do not call Task.WaitAll with a single argument #33807
Labels
api-approved
API was approved in API review, it can be implemented
area-System.Threading.Tasks
code-analyzer
Marks an issue that suggests a Roslyn analyzer
code-fixer
Marks an issue that suggests a Roslyn code fixer
Milestone
Comments
terrajobst
added
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
area-System.Threading.Tasks
code-analyzer
Marks an issue that suggests a Roslyn analyzer
labels
Mar 19, 2020
Dotnet-GitSync-Bot
added
the
untriaged
New issue has not been triaged by the area owner
label
Mar 19, 2020
jeffhandley
added
the
code-fixer
Marks an issue that suggests a Roslyn code fixer
label
Mar 21, 2020
Estimates:
|
terrajobst
removed
the
untriaged
New issue has not been triaged by the area owner
label
Mar 21, 2020
I have a working analyzer for this as well, if this is ready to implement. #33806 is very similar, my analyzer would offer a great basis for that issue. |
Here is a usage example: using System.Threading.Tasks;
namespace MyNamespace
{
class Sample
{
public static void Main()
{
Task task = ...;
// Instead of this
Task.WaitAll(task);
// Suggest this
task.Wait();
// Instead of this
Task.WaitAll(GetTask());
// Suggest this
GetTask().Wait();
}
static Task GetTask()
{
return ...;
}
}
}
Questions
|
carlossanlop
added
api-ready-for-review
API is ready for review, it is NOT ready for implementation
and removed
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
labels
Oct 30, 2020
terrajobst
added
api-approved
API was approved in API review, it can be implemented
and removed
api-ready-for-review
API is ready for review, it is NOT ready for implementation
labels
Feb 4, 2021
void M(Task task)
{
// Before
Task.WaitAll(task);
// After
task.Wait();
} |
I'll take this and #33806 |
carlossanlop
removed
the
help wanted
[up-for-grabs] Good issue for external contributors
label
Feb 5, 2021
It's yours, @ryzngard. Thanks for your help! Let us know if you have any questions. |
5 tasks
This was implemented as CA1842/1843. Thanks! |
ghost
locked as resolved and limited conversation to collaborators
Aug 12, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
api-approved
API was approved in API review, it can be implemented
area-System.Threading.Tasks
code-analyzer
Marks an issue that suggests a Roslyn analyzer
code-fixer
Marks an issue that suggests a Roslyn code fixer
Task.Wait
can be used instead.Category: Performance
The text was updated successfully, but these errors were encountered: