This commit fixes a bug in the Subscribe trait implementation for AsyncStd{in,out}Stream structures in the wasmtime-wasi crate. Previously these implementations would create a future for the duration of a single poll but then the future was dropped which could lead to lost wakeups as the waker is gone after the future is dropped. The fix was to use a tokio::sync::Mutex here instead of a std::sync::Mutex and leave some comments about why contention isn't expected.
This commit fixes a bug in the
Subscribe
trait implementation forAsyncStd{in,out}Stream
structures in thewasmtime-wasi
crate. Previously these implementations would create a future for the duration of a singlepoll
but then the future was dropped which could lead to lost wakeups as the waker is gone after the future is dropped. The fix was to use atokio::sync::Mutex
here instead of astd::sync::Mutex
and leave some comments about why contention isn't expected.Closes #8781