diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-04-16 11:43:50 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-04-18 12:50:52 +0200 |
commit | f9da3f0cce7188dc9ddbc5c32da550f940ed5f38 (patch) | |
tree | 3e4e939b352e38282c5635fe4af6bb58be9ea934 /src | |
parent | d17dfc7bb1660b3579407e5f6e106b0431cc264b (diff) | |
download | android-node-v8-f9da3f0cce7188dc9ddbc5c32da550f940ed5f38.tar.gz android-node-v8-f9da3f0cce7188dc9ddbc5c32da550f940ed5f38.tar.bz2 android-node-v8-f9da3f0cce7188dc9ddbc5c32da550f940ed5f38.zip |
src: enable non-nestable V8 platform tasks
We never execute tasks in a nested fashion, so enabling them should
be as simple as forwarding tasks to the existing `Post*` methods.
PR-URL: https://github.com/nodejs/node/pull/27252
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/node_platform.cc | 10 | ||||
-rw-r--r-- | src/node_platform.h | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/node_platform.cc b/src/node_platform.cc index 47c4373a0f..8c097c03c7 100644 --- a/src/node_platform.cc +++ b/src/node_platform.cc @@ -257,6 +257,16 @@ void PerIsolatePlatformData::PostDelayedTask( uv_async_send(flush_tasks_); } +void PerIsolatePlatformData::PostNonNestableTask(std::unique_ptr<Task> task) { + PostTask(std::move(task)); +} + +void PerIsolatePlatformData::PostNonNestableDelayedTask( + std::unique_ptr<Task> task, + double delay_in_seconds) { + PostDelayedTask(std::move(task), delay_in_seconds); +} + PerIsolatePlatformData::~PerIsolatePlatformData() { Shutdown(); } diff --git a/src/node_platform.h b/src/node_platform.h index 55a1e80618..c3a1fb04fa 100644 --- a/src/node_platform.h +++ b/src/node_platform.h @@ -64,6 +64,13 @@ class PerIsolatePlatformData : double delay_in_seconds) override; bool IdleTasksEnabled() override { return false; } + // Non-nestable tasks are treated like regular tasks. + bool NonNestableTasksEnabled() const override { return true; } + bool NonNestableDelayedTasksEnabled() const override { return true; } + void PostNonNestableTask(std::unique_ptr<v8::Task> task) override; + void PostNonNestableDelayedTask(std::unique_ptr<v8::Task> task, + double delay_in_seconds) override; + void AddShutdownCallback(void (*callback)(void*), void* data); void Shutdown(); |