Skip to content

Commit

Permalink
[platform] Override CreateJob instead of PostJob (#145)
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 authored and victorgomes committed Aug 11, 2022
1 parent 95ada16 commit 49beedd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/node_platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,8 @@ bool NodePlatform::FlushForegroundTasks(Isolate* isolate) {
return per_isolate->FlushForegroundTasksInternal();
}

std::unique_ptr<v8::JobHandle> NodePlatform::PostJob(v8::TaskPriority priority,
std::unique_ptr<v8::JobTask> job_task) {
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 49beedd

Please sign in to comment.