Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: rename WorkerThreadMain to PlatformWorkerThread #21982

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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