summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2018-07-26 08:41:57 +0200
committerMichaël Zasso <targos@protonmail.com>2018-07-29 21:41:28 +0200
commitafc5636fe6fd7bff1dbf702182fe0177e335d8d1 (patch)
tree73c70fe72aff192273386094685df30b61c6fe70
parente3a47025ac0c8e89b73b91b137bb70f6b2f3d73a (diff)
downloadnode-new-afc5636fe6fd7bff1dbf702182fe0177e335d8d1.tar.gz
src: rename WorkerThreadMain to PlatformWorkerThread
Refs: https://github.com/nodejs/node/pull/21079#discussion_r194251183 PR-URL: https://github.com/nodejs/node/pull/21982 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
-rw-r--r--src/node_platform.cc6
-rw-r--r--test/parallel/test-trace-events-metadata.js2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/node_platform.cc b/src/node_platform.cc
index ce9117ae38..6a3ae2e5dc 100644
--- a/src/node_platform.cc
+++ b/src/node_platform.cc
@@ -17,9 +17,9 @@ using v8::TracingController;
namespace {
-static void WorkerThreadMain(void* data) {
+static void PlatformWorkerThread(void* data) {
TRACE_EVENT_METADATA1("__metadata", "thread_name", "name",
- "BackgroundTaskRunner");
+ "PlatformWorkerThread");
TaskQueue<Task>* pending_worker_tasks = static_cast<TaskQueue<Task>*>(data);
while (std::unique_ptr<Task> task = pending_worker_tasks->BlockingPop()) {
task->Run();
@@ -32,7 +32,7 @@ static void WorkerThreadMain(void* data) {
WorkerThreadsTaskRunner::WorkerThreadsTaskRunner(int thread_pool_size) {
for (int i = 0; i < thread_pool_size; i++) {
std::unique_ptr<uv_thread_t> t { new uv_thread_t() };
- if (uv_thread_create(t.get(), WorkerThreadMain,
+ if (uv_thread_create(t.get(), PlatformWorkerThread,
&pending_worker_tasks_) != 0) {
break;
}
diff --git a/test/parallel/test-trace-events-metadata.js b/test/parallel/test-trace-events-metadata.js
index 01e019c190..8f9648902d 100644
--- a/test/parallel/test-trace-events-metadata.js
+++ b/test/parallel/test-trace-events-metadata.js
@@ -31,7 +31,7 @@ proc.once('exit', common.mustCall(() => {
trace.args.name === 'JavaScriptMainThread'));
assert(traces.some((trace) =>
trace.name === 'thread_name' &&
- trace.args.name === 'BackgroundTaskRunner'));
+ trace.args.name === 'PlatformWorkerThread'));
assert(traces.some((trace) =>
trace.name === 'version' &&
trace.args.node === process.versions.node));