refactor concurrent_imports
support in wasmtime-wit-bindgen
#18
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 is yet another major rework of
concurrent_imports
; this time, the goal is to supportadd_to_linker_get_host
properly such that input and output types of thehost_getter
param need not be the same. After much perserverance with Alex and Lann, we arrived at something the compiler would accept, but it requires thread-local storage andunsafe
here and there, alas.One drawback of this approach is that we no longer generate forwarding
impl
s for&mut T
, and thus noadd_to_linker
functions. That's related to concurrent functions taking&mut Accessor<T, Self>
as a parameter and the borrow checker not allowing us to map anAccessor<T, &mut U>
to aAccessor<T, U>
despite all our efforts to convince it.Finally, this adds
SpawnHandle
andAbortOnDropHandle
types for abortingspawn
ed tasks. I haven't actually tested this yet, but Roman has a test case for his WASIp3 implementation, so I'm sure he'll let me know if there are problems.