Skip to content

Commit 1584d8b

Browse files
committed
Minor fixes
1 parent 7a4cd05 commit 1584d8b

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

crates/wasmtime/src/runtime/component/concurrent.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ use {
5656
Component, ComponentInstanceId, HasData, HasSelf, Instance,
5757
func::{self, Func, Options},
5858
},
59-
fiber::{self, AsyncCx, StoreFiber, StoreFiberYield},
59+
fiber::{self, StoreFiber, StoreFiberYield},
6060
store::{StoreInner, StoreOpaque, StoreToken},
6161
vm::{
6262
SendSyncPtr, VMFuncRef, VMMemoryDefinition, VMStore,
@@ -1850,10 +1850,7 @@ impl Instance {
18501850
assert!(suspend_reason.is_none());
18511851
*suspend_reason = Some(reason);
18521852

1853-
let async_cx = AsyncCx::new(store.store_opaque_mut());
1854-
// SAFETY: The `Store` we used to create the `AsyncCx` above remains
1855-
// valid.
1856-
unsafe { async_cx.suspend(StoreFiberYield::ReleaseStore)? };
1853+
store.with_blocking(|_, cx| cx.suspend(StoreFiberYield::ReleaseStore))?;
18571854

18581855
if let Some(task) = task {
18591856
*self.concurrent_state_mut(store).guest_task() = old_guest_task;

crates/wasmtime/src/runtime/fiber.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ impl StoreOpaque {
401401
/// # Panics
402402
///
403403
/// Panics if this is invoked outside the context of a fiber.
404-
#[expect(dead_code, reason = "will be used by async things soon")]
405404
pub(crate) fn with_blocking<R>(
406405
&mut self,
407406
f: impl FnOnce(&mut Self, &mut BlockingContext<'_, '_>) -> R,

0 commit comments

Comments
 (0)