Skip to content

Commit 2e48534

Browse files
committed
src: use node- prefix on thread names
1 parent 2030fd3 commit 2e48534

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

src/inspector_agent.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static void StartIoThreadWakeup(int signo, siginfo_t* info, void* ucontext) {
8484
}
8585

8686
inline void* StartIoThreadMain(void* unused) {
87-
uv_thread_setname("SignalInspector");
87+
uv_thread_setname("node-SignalInspector");
8888
for (;;) {
8989
uv_sem_wait(&start_io_thread_semaphore);
9090
Mutex::ScopedLock lock(start_io_thread_async_mutex);

src/inspector_io.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ void InspectorIo::ThreadMain(void* io) {
286286
}
287287

288288
void InspectorIo::ThreadMain() {
289-
int thread_name_error = uv_thread_setname("InspectorIo");
289+
int thread_name_error = uv_thread_setname("node-InspectorIo");
290290
if (!thread_name_error) [[unlikely]] {
291291
per_process::Debug(node::DebugCategory::INSPECTOR_SERVER,
292292
"Failed to set thread name for Inspector\n");

src/node.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ InitializeOncePerProcessInternal(const std::vector<std::string>& args,
12341234
}
12351235

12361236
if (!(flags & ProcessInitializationFlags::kNoInitializeNodeV8Platform)) {
1237-
uv_thread_setname("MainThread");
1237+
uv_thread_setname("node-MainThread");
12381238
per_process::v8_platform.Initialize(
12391239
static_cast<int>(per_process::cli_options->v8_thread_pool_size));
12401240
result->platform_ = per_process::v8_platform.Platform();

src/node_platform.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static void PrintSourceLocation(const v8::SourceLocation& location) {
4949
}
5050

5151
static void PlatformWorkerThread(void* data) {
52-
uv_thread_setname("V8Worker");
52+
uv_thread_setname("node-V8Worker");
5353
std::unique_ptr<PlatformWorkerData>
5454
worker_data(static_cast<PlatformWorkerData*>(data));
5555

@@ -101,7 +101,7 @@ class WorkerThreadsTaskRunner::DelayedTaskScheduler {
101101

102102
std::unique_ptr<uv_thread_t> Start() {
103103
auto start_thread = [](void* data) {
104-
uv_thread_setname("DelayedTaskSchedulerWorker");
104+
uv_thread_setname("node-DelayedTaskSchedulerWorker");
105105
static_cast<DelayedTaskScheduler*>(data)->Run();
106106
};
107107
std::unique_ptr<uv_thread_t> t { new uv_thread_t() };

src/node_watchdog.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Watchdog::~Watchdog() {
8080

8181

8282
void Watchdog::Run(void* arg) {
83-
uv_thread_setname("Watchdog");
83+
uv_thread_setname("node-Watchdog");
8484
Watchdog* wd = static_cast<Watchdog*>(arg);
8585

8686
// UV_RUN_DEFAULT the loop will be stopped either by the async or the
@@ -230,7 +230,7 @@ void TraceSigintWatchdog::HandleInterrupt() {
230230

231231
#ifdef __POSIX__
232232
void* SigintWatchdogHelper::RunSigintWatchdog(void* arg) {
233-
uv_thread_setname("SigintWatchdog");
233+
uv_thread_setname("node-SigintWatchdog");
234234
// Inside the helper thread.
235235
bool is_stopping;
236236
do {

src/tracing/agent.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void Agent::Start() {
9898
uv_thread_create(
9999
&thread_,
100100
[](void* arg) {
101-
uv_thread_setname("TraceEventWorker");
101+
uv_thread_setname("node-TraceEventWorker");
102102
Agent* agent = static_cast<Agent*>(arg);
103103
uv_run(&agent->tracing_loop_, UV_RUN_DEFAULT);
104104
},

test/addons/uv-thread-name/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ const bindingPath = require.resolve(`./build/${common.buildType}/binding`);
1212
const binding = require(bindingPath);
1313

1414
if (isMainThread) {
15-
assert.strictEqual(binding.getThreadName(), 'MainThread');
15+
assert.strictEqual(binding.getThreadName(), 'node-MainThread');
1616

1717
const worker = new Worker(__filename);
1818
worker.on('message', common.mustCall((data) => {
19-
assert.strictEqual(data, 'WorkerThread');
19+
assert.strictEqual(data, 'node-WorkerThread');
2020
}));
2121
worker.on('error', common.mustNotCall());
2222
worker.on('exit', common.mustCall((code) => {

0 commit comments

Comments
 (0)