0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-31 09:14:20 -04:00
denoland-deno/ext
Aapo Alasuutari 75acec0aea
fix(ext/ffi): Fix UnsafeCallback ref'ing making Deno enter a live-loop (#16216)
Fixes #15136

Currently `UnsafeCallback` class' `ref()` and `unref()` methods rely on
the `event_loop_middleware` implementation in core. If even a single
`UnsafeCallback` is ref'ed, then the FFI event loop middleware will
always return `true` to signify that there may still be more work for
the event loop to do.

The middleware handling in core does not wait a moment to check again,
but will instead synchronously directly re-poll the event loop and
middlewares for more work. This becomes a live-loop.

This PR introduces a `Future` implementation for the `CallbackInfo`
struct that acts as the intermediary data storage between an
`UnsafeCallback` and the `libffi` C callback. Ref'ing a callback now
means calling an async op that binds to the `CallbackInfo` Future and
only resolves once the callback is unref'ed. The `libffi` C callback
will call the waker of this Future when it fires to make sure that the
main thread wakes up to receive the callback.
2022-10-15 19:19:46 +05:30
..
broadcast_channel chore: forward v1.26.1 release commit to main (#16178) 2022-10-06 16:49:40 -04:00
cache feat(core): add Deno.core.writeAll(rid, chunk) (#16228) 2022-10-10 10:28:35 +02:00
console fix sparse array inspection (#16204) 2022-10-10 10:22:21 -04:00
crypto fix(ext/crypto): correct HMAC get key length op (#16201) 2022-10-15 10:53:35 +05:30
fetch fix(ext/fetch): throw TypeError on read failure (#16219) 2022-10-12 09:23:33 +02:00
ffi fix(ext/ffi): Fix UnsafeCallback ref'ing making Deno enter a live-loop (#16216) 2022-10-15 19:19:46 +05:30
flash feat(core): improve resource read & write traits (#16115) 2022-10-09 14:49:25 +00:00
http feat(core): improve resource read & write traits (#16115) 2022-10-09 14:49:25 +00:00
napi fix(napi): move napi symbols file (#16179) 2022-10-07 09:21:43 +05:30
net feat(core): add Deno.core.writeAll(rid, chunk) (#16228) 2022-10-10 10:28:35 +02:00
node chore: forward v1.26.1 release commit to main (#16178) 2022-10-06 16:49:40 -04:00
tls chore: forward v1.26.1 release commit to main (#16178) 2022-10-06 16:49:40 -04:00
url chore: forward v1.26.1 release commit to main (#16178) 2022-10-06 16:49:40 -04:00
web fix(ext/web/streams): enqueue to second branch before closing (#16269) 2022-10-14 09:51:39 +00:00
webgpu chore: forward v1.26.1 release commit to main (#16178) 2022-10-06 16:49:40 -04:00
webidl chore: forward v1.26.1 release commit to main (#16178) 2022-10-06 16:49:40 -04:00
websocket fix(ext/websocket): panic on no next ws message from an already closed stream (#16004) 2022-10-15 11:08:09 +02:00
webstorage chore: forward v1.26.1 release commit to main (#16178) 2022-10-06 16:49:40 -04:00