You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: only marshal promise resolution when created on the runtime loop
The promise proxy captures the run loop at construction and, when a
promise resolves on a different thread, marshals the resolution back to
that captured run loop. When a promise is constructed while native code
runs JS on a background thread, the captured run loop belongs to that
background thread, which is dormant once the call returns. A resolution
that arrives later on the runtime loop (for example from a setTimeout)
is scheduled onto the dormant run loop and never runs, so the promise
hangs forever.
Only marshal the resolution when the promise was created on the runtime
loop, which is always being pumped. A promise created on any other
thread resolves inline on whichever thread settles it. The same gate is
applied to the get trap on the returned promise.
Fixes#330
0 commit comments