Implement some more extension functions #99
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR started from a want to add
Process.WaitForExitAsync
.The .NET library source for
Process.WaitForExitAsync
usesCancellationToken.UnsafeRegister
so I also added those into this PR, as well as a missingCancellationToken.Register
overload that I came across while copying tests over forCancellationToken.UnsafeRegister
.Also, while working on the tests for
CancellationToken.UnsafeRegister
, I noticed thatCancellationTokenSource.CancelAsync
had been added in a previous commit, but no tests were added for it at the same time. So I figured I should copy some tests forCancellationTokenSource.CancelAsync
from the .NET repo while I was working in that area, which led me to hit a deadlock with the current implementation ofCancellationTokenSource.CancelAsync
. So I also added a workaround in that function while I was there.I didn't expect to go down such a rabbit hole when all I wanted was
Process.WaitForExitAsync
, but I think everything I've added in this PR is worthwhile adding to the library.