Is there a lexical style / way to write to Rust code so that the type / borrow / lifetime checker can be used to ensure the following invariant:
no blocked (async) task is holding a RefCell::borrow_mut() ?
Is there a lexical style / way to write to Rust code so that the type / borrow / lifetime checker can be used to ensure the following invariant:
no blocked (async) task is holding a RefCell::borrow_mut() ?
If you're using the multithreaded async runtime, it is enforced by default, since RefMut
is neither Send
nor Sync
and therefore can't be held across await
.
I'm on Rust / wasm, using wasm_bindgen_futures. I am compiling with target=wasm32-unknown-unknown and running it only in the Chrome browser.
I suspect the following is happening (but not sure how to verify / test this):
let x: Rc<RefCell<...>>;
Not sure how to verify this.
Even on a single threaded async runtime, is it possible to prevent a RefMut to be held across an await ?
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.