From 4abb09c9c95c52666545fb4092d284a9d47530ab Mon Sep 17 00:00:00 2001 From: Clemens Backes Date: Thu, 21 Jul 2022 14:49:59 +0200 Subject: [PATCH] [platform] Override CreateJob instead of PostJob PostJob will call out to CreateJob in its default implementation, so it's sufficient to only override CreateJob. The default implementation of CreateJob will return a nullptr though, so we cannot use it in V8 before Node overrides it. --- src/node_platform.cc | 4 ++-- src/node_platform.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node_platform.cc b/src/node_platform.cc index 9787cbb3edc2e2..6c627bf25778c0 100644 --- a/src/node_platform.cc +++ b/src/node_platform.cc @@ -518,8 +518,8 @@ bool NodePlatform::FlushForegroundTasks(Isolate* isolate) { return per_isolate->FlushForegroundTasksInternal(); } -std::unique_ptr NodePlatform::PostJob(v8::TaskPriority priority, - std::unique_ptr job_task) { +std::unique_ptr NodePlatform::CreateJob( + v8::TaskPriority priority, std::unique_ptr job_task) { return v8::platform::NewDefaultJobHandle( this, priority, std::move(job_task), NumberOfWorkerThreads()); } diff --git a/src/node_platform.h b/src/node_platform.h index 4a05f3bba58c8e..1062f3b1b9c386 100644 --- a/src/node_platform.h +++ b/src/node_platform.h @@ -155,7 +155,7 @@ class NodePlatform : public MultiIsolatePlatform { double CurrentClockTimeMillis() override; v8::TracingController* GetTracingController() override; bool FlushForegroundTasks(v8::Isolate* isolate) override; - std::unique_ptr PostJob( + std::unique_ptr CreateJob( v8::TaskPriority priority, std::unique_ptr job_task) override;