diff --git a/crates/async-wasi/Cargo.toml b/crates/async-wasi/Cargo.toml index 57ee21ec4..03ae67529 100644 --- a/crates/async-wasi/Cargo.toml +++ b/crates/async-wasi/Cargo.toml @@ -7,7 +7,7 @@ license = "Apache-2.0" name = "async-wasi" readme = "README.md" repository = "https://github.com/WasmEdge/wasmedge-rust-sdk" -version = "0.2.0" +version = "0.2.1" [dependencies] log = "0.4" diff --git a/crates/async-wasi/src/snapshots/common/net/async_tokio.rs b/crates/async-wasi/src/snapshots/common/net/async_tokio.rs index 4f0304f58..09355c220 100644 --- a/crates/async-wasi/src/snapshots/common/net/async_tokio.rs +++ b/crates/async-wasi/src/snapshots/common/net/async_tokio.rs @@ -154,16 +154,16 @@ pub(crate) struct SocketWritable(pub(crate) AtomicI8); impl SocketWritable { pub(crate) async fn writable(&self) { let b = self.0.fetch_sub(1, std::sync::atomic::Ordering::Acquire); - SocketWritableFuture(b).await; + tokio::time::timeout(Duration::from_secs(10), SocketWritableFuture(b)).await; } pub(crate) fn set_writable(&self) { - self.0.store(2, std::sync::atomic::Ordering::Release) + self.0.store(5, std::sync::atomic::Ordering::Release) } } impl Default for SocketWritable { fn default() -> Self { - Self(AtomicI8::new(2)) + Self(AtomicI8::new(5)) } }