Dev/murphymcquet/avoid spinlock pipe connect #283
+268
−5
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.
Two bugs (https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2227577/ and https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1824420/) have been filed because the current implementation for connecting to the controller pipe only offers options to (1) spin indefinitely while waiting to connect or (2) exit immediately but throw a TimeoutException. Neither implementation is ideal. This was done because the existing .NET implementation for connecting to pipes "async" is not actually async. In the ideal scenario, we would simply wait and return to the caller without spinning or throwing an exception.
This PR implements an async version of the pipe connection by creating a wrapper around the Win32 APIs for pipe connection. This will not work on non-Windows machines, and has been implemented accordingly.