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>
This commit is contained in:
parent
d17dfc7bb1
commit
f9da3f0cce
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user