Skip to content

Commit

Permalink
[platform] Override CreateJob instead of PostJob
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
backes committed Jul 21, 2022
1 parent 11bb61b commit b005bfd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/node_platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ bool NodePlatform::FlushForegroundTasks(Isolate* isolate) {
return per_isolate->FlushForegroundTasksInternal();
}

std::unique_ptr<v8::JobHandle> NodePlatform::PostJob(v8::TaskPriority priority,
std::unique_ptr<v8::JobHandle> NodePlatform::CreateJob(v8::TaskPriority priority,
std::unique_ptr<v8::JobTask> job_task) {
return v8::platform::NewDefaultJobHandle(
this, priority, std::move(job_task), NumberOfWorkerThreads());
Expand Down
2 changes: 1 addition & 1 deletion src/node_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class NodePlatform : public MultiIsolatePlatform {
double CurrentClockTimeMillis() override;
v8::TracingController* GetTracingController() override;
bool FlushForegroundTasks(v8::Isolate* isolate) override;
std::unique_ptr<v8::JobHandle> PostJob(
std::unique_ptr<v8::JobHandle> CreateJob(
v8::TaskPriority priority,
std::unique_ptr<v8::JobTask> job_task) override;

Expand Down

0 comments on commit b005bfd

Please sign in to comment.