Make RegionHandlers be Send + Sync by default#318
Open
martin-hughes wants to merge 1 commit into
Open
Conversation
Preserve the option to have non Send/Sync RegionHandlers for anyone who finds that useful. There is an API change in `install_region_handler` - but region handlers are not currently supported so this should not be an issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 fixes #301 in my preferred way (the Send interpreter remains called
Interpreter) but still allows for an easy non-send interpreter as well.NB: The function signature of
install_region_handlerchanges to require aBoxto be passed to it. This was the simplest way of avoiding a compiler error aboutSized. Plus it relieves that function of the responsibility to construct a Box 😉I've done a bunch of testing to make sure this works as expected, but there's no easy way to write "compile fail" tests except as doctests - and the need for a dummy
RegionHandlerjust makes it look very messy. So I assert to you that it works correctly!Ideally I'd like to remove the
unsafe implblocks forInterpreter, but there's more work to do first (see also #307). This PR addresses probably the most obvious unsafety of pretending that allRegionHandlers are Send + Sync.