Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClemens Backes <clemensb@chromium.org>2020-07-21 11:11:35 +0300
committerMichaƫl Zasso <targos@protonmail.com>2020-10-18 21:17:48 +0300
commitb65e5aeaa7bd68a9a02530af3ec40616c468b2fd (patch)
tree0d43b12207306c0e3f67cf2b106fe8fa07740819 /src/node_platform.cc
parent80e8aec4a5884adbc3bbf38ccde9674ac58ba326 (diff)
src: implement NodePlatform::PostJob
V8 is starting to use the job API for Wasm compilation, so the node platform should implement that. PR-URL: https://github.com/nodejs/node/pull/35415 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'src/node_platform.cc')
-rw-r--r--src/node_platform.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/node_platform.cc b/src/node_platform.cc
index c15a95128e9..eb918bdd559 100644
--- a/src/node_platform.cc
+++ b/src/node_platform.cc
@@ -513,6 +513,12 @@ 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) {
+ return v8::platform::NewDefaultJobHandle(
+ this, priority, std::move(job_task), NumberOfWorkerThreads());
+}
+
bool NodePlatform::IdleTasksEnabled(Isolate* isolate) {
return ForIsolate(isolate)->IdleTasksEnabled();
}