Skip to content

Commit

Permalink
src: rename WorkerThreadMain to PlatformWorkerThread
Browse files Browse the repository at this point in the history
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 29, 2018
1 parent e3a4702 commit afc5636
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/node_platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-trace-events-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit afc5636

Please sign in to comment.