Skip to content
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

Avoid synchronizing access to TextWriter.Null in Console #83296

Merged
merged 1 commit into from Mar 11, 2023

Conversation

stephentoub
Copy link
Member

If SetOut/Error are used to silence Console by using TextWriter.Null, we don't need to wrap the writer in a synchronized one like we normally do, since all operations are nops and there's no need to serialize access.

If SetOut/Error are used to silence Console by using TextWriter.Null, we don't need to wrap the writer in a synchronized one like we normally do, since all operations are nops and there's no need to serialize access.
@ghost
Copy link

ghost commented Mar 11, 2023

Tagging subscribers to this area: @dotnet/area-system-console
See info in area-owners.md if you want to be subscribed.

Issue Details

If SetOut/Error are used to silence Console by using TextWriter.Null, we don't need to wrap the writer in a synchronized one like we normally do, since all operations are nops and there's no need to serialize access.

Author: stephentoub
Assignees: -
Labels:

area-System.Console

Milestone: -

@stephentoub stephentoub merged commit 35f87ec into dotnet:main Mar 11, 2023
@stephentoub stephentoub deleted the consolewritersync branch March 11, 2023 16:36
@dotnet dotnet locked as resolved and limited conversation to collaborators Apr 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants