Skip to content
Snippets Groups Projects
Commit f8a96987 authored by Cheng Shao's avatar Cheng Shao :beach:
Browse files

wasm: use MVar as JSFFI import blocking mechanism

Previously, when blocking on a JSFFI import, we push a custom
stg_jsffi_block stack frame and arrange the `promise.then` callback to
write to that stack frame. It turns out we can simply use the good old
MVar to implement the blocking logic, with a few benefits:

- Less maintenance burden. We can drop the stg_jsffi_block related Cmm
  code without loss of functionality.
- It interacts better with existing async exception mechanism. throwTo
  would properly block the caller if the target thread is masking
  async exceptions.

(cherry picked from commit 9cd9f347)
parent e8afc767
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment