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

Added Try/Finally pattern when locking the back buffer #3568

Merged
merged 1 commit into from Oct 31, 2017

Conversation

Projects
None yet
3 participants
@mjjames
Contributor

mjjames commented Oct 30, 2017

Added Try/Finally pattern when locking the back buffer

Summary

i noted that the lock and unlock has no safety associated with it and you could fall into having a locked backbuffer without ever releasing it. Simply added try/finally to the sample to make it more compl

Details

Just encouraging try/finally pattern when locks are involved.

Suggested Reviewers

If you know who should review this, use '@' to request a review.

Update Program.cs
i noted that the lock and unlock has no safety associated with it and you could fall into having a locked backbuffer without ever releasing it. Simply added try/finally to the sample to make it more complete
@dnfclas

This comment has been minimized.

Show comment
Hide comment
@dnfclas

dnfclas Oct 30, 2017

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot

dnfclas commented Oct 30, 2017

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot

@rpetrusha

Thanks for contributing to the dotnet/docs repo and adding the try/finally block, @mjjames. We'll merge your PR now. Changes should appear live on docs.microsoft.com tomorrow.

@rpetrusha rpetrusha merged commit 196732a into dotnet:master Oct 31, 2017

2 checks passed

OpenPublishing.Build Validation status: passed
Details
WIP ready for review
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment