Fibers: adds internal version=ucontext_Posix #21368
Open
+30
−28
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 was all already here, but PR was dedicated to fix another thing. That's why I decided to put it in a separate PR
This PR assigns a separate
version
forFiber
context switching based on Posix'sucontext
. So that it can be used manually (by enforcingversion=ucontext_Posix
) on any Posix system fort comparing context switching operation for debugging and testing purposes.To make this work ucontext's
swapcontext
block was moved to the beginning of version conditionals.Nothing will change for end users by this PR. At the same time, druntime developers will be able to switch Fiber's swapcontext from our own native assembler implementations to supplied by Posix's to check and compare context switching functionality. Maintainers will be able urgently switch to the Posix implementation if it is found that one of our implementations broken