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

Implement some more extension functions #99

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

sbeca
Copy link
Contributor

@sbeca sbeca commented Nov 6, 2023

This PR started from a want to add Process.WaitForExitAsync.

The .NET library source for Process.WaitForExitAsync uses CancellationToken.UnsafeRegister so I also added those into this PR, as well as a missing CancellationToken.Register overload that I came across while copying tests over for CancellationToken.UnsafeRegister.

Also, while working on the tests for CancellationToken.UnsafeRegister, I noticed that CancellationTokenSource.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 for CancellationTokenSource.CancelAsync from the .NET repo while I was working in that area, which led me to hit a deadlock with the current implementation of CancellationTokenSource.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.

Comment on lines -20 to +22
var path = Path.Combine(solutionDirectory, @"Consume\bin\Debug\netstandard2.0\Consume.dll");
var md = Path.Combine(solutionDirectory, @"..\api_list.include.md");
var path = Path.Combine(solutionDirectory, "Consume", "bin", "Debug", "netstandard2.0", "Consume.dll");
var md = Path.Combine(solutionDirectory, "..", "api_list.include.md");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was changed so that I could run it on macOS

@sbeca
Copy link
Contributor Author

sbeca commented Nov 6, 2023

I'll fix the build errors now

@sbeca sbeca marked this pull request as draft November 6, 2023 11:09
@sbeca sbeca force-pushed the Process-WaitForExitAsync branch 4 times, most recently from a57e966 to 7b41188 Compare November 6, 2023 13:03
@sbeca sbeca closed this Nov 6, 2023
@sbeca sbeca reopened this Nov 6, 2023
@sbeca sbeca marked this pull request as ready for review November 6, 2023 13:59
@sbeca
Copy link
Contributor Author

sbeca commented Nov 6, 2023

Build/test errors have been fixed

@sbeca sbeca force-pushed the Process-WaitForExitAsync branch from 7b41188 to cda24d3 Compare November 6, 2023 14:06
@SimonCropp
Copy link
Owner

@sbeca very nice work. will merge and deploy this now. should be on nuget in ~20min

@SimonCropp SimonCropp merged commit e364d18 into SimonCropp:main Nov 7, 2023
1 check passed
@SimonCropp SimonCropp added this to the 1.30.0 milestone Nov 7, 2023
@sbeca sbeca deleted the Process-WaitForExitAsync branch November 7, 2023 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants