diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-11-24 02:34:36 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-11-29 13:21:39 +0300 |
commit | 9e9e48bf7e20a425d02c2538da106ae97c0688c8 (patch) | |
tree | 2a722bc2519a426d4d1809e9181b973dbde157a0 /src/env.h | |
parent | 94e4cbd808d09756b9eb601971450bc552392b69 (diff) |
src: use uv_async_t for WeakRefs
Schedule a task on the main event loop, similar to what the HTML
spec recommends for browsers.
Alternative to https://github.com/nodejs/node/pull/30198
PR-URL: https://github.com/nodejs/node/pull/30616
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/env.h')
-rw-r--r-- | src/env.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/env.h b/src/env.h index 495d92471a3..027f5c0bacf 100644 --- a/src/env.h +++ b/src/env.h @@ -1128,7 +1128,8 @@ class Environment : public MemoryRetainer { void RunAtExitCallbacks(); void RegisterFinalizationGroupForCleanup(v8::Local<v8::FinalizationGroup> fg); - bool RunWeakRefCleanup(); + void RunWeakRefCleanup(); + void CleanupFinalizationGroups(); // Strings and private symbols are shared across shared contexts // The getters simply proxy to the per-isolate primitive. @@ -1270,6 +1271,7 @@ class Environment : public MemoryRetainer { uv_idle_t immediate_idle_handle_; uv_prepare_t idle_prepare_handle_; uv_check_t idle_check_handle_; + uv_async_t cleanup_finalization_groups_async_; bool profiler_idle_notifier_started_ = false; AsyncHooks async_hooks_; |