Skip to content

Commit

Permalink
Merge pull request #119 from second-state/fix/async_wasi
Browse files Browse the repository at this point in the history
Fix/async wasi
  • Loading branch information
L-jasmine authored Jul 29, 2024
2 parents ef01eb6 + da8eb2a commit de735ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/async-wasi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions crates/async-wasi/src/snapshots/common/net/async_tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}

Expand Down

0 comments on commit de735ee

Please sign in to comment.