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

Handle possible null in SerialStream.Dispose() on Windows #103671

Closed
wants to merge 1 commit into from

Conversation

omajid
Copy link
Member

@omajid omajid commented Jun 18, 2024

The code expects multiple threads to call it, and it's possible one thread sets _handle to null before the second thread enter the block and tries to call _handle.Close().

The code expects multiple threads to call it, and it's possible one
thread sets `_handle` to null before the second thread enter the block
and tries to call `_handle.Close()`.
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jun 18, 2024
Copy link
Contributor

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

@stephentoub
Copy link
Member

Thanks. What is the race condition you're trying to fix? Calling Dispose concurrently with itself is not supported.

@stephentoub stephentoub added the needs-author-action An issue or pull request that requires more info or actions from the author. label Jul 9, 2024
@stephentoub
Copy link
Member

Closing due to no response. But thanks for trying to improve things here.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.IO community-contribution Indicates that the PR has been added by a community member needs-author-action An issue or pull request that requires more info or actions from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants