Skip to content
Permalink
Browse files

src: rename WorkerThreadMain to PlatformWorkerThread

Refs: #21079 (comment)

PR-URL: #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>
  • Loading branch information...
targos committed Jul 26, 2018
1 parent e3a4702 commit afc5636fe6fd7bff1dbf702182fe0177e335d8d1
Showing with 4 additions and 4 deletions.
  1. +3 −3 src/node_platform.cc
  2. +1 −1 test/parallel/test-trace-events-metadata.js
@@ -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;
}
@@ -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));

0 comments on commit afc5636

Please sign in to comment.
You can’t perform that action at this time.