Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 24428fc

Browse filesBrowse files
theanarkhrichardlau
authored andcommitted
src: add name for more threads
PR-URL: #59601 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent b806661 commit 24428fc
Copy full SHA for 24428fc

File tree

Expand file treeCollapse file tree

3 files changed

+12
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+12
-5
lines changed
Open diff view settings
Collapse file

‎src/node_platform.cc‎

Copy file name to clipboardExpand all lines: src/node_platform.cc
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class WorkerThreadsTaskRunner::DelayedTaskScheduler {
9696

9797
std::unique_ptr<uv_thread_t> Start() {
9898
auto start_thread = [](void* data) {
99+
uv_thread_setname("DelayedTaskSchedulerWorker");
99100
static_cast<DelayedTaskScheduler*>(data)->Run();
100101
};
101102
std::unique_ptr<uv_thread_t> t { new uv_thread_t() };
Collapse file

‎src/node_watchdog.cc‎

Copy file name to clipboardExpand all lines: src/node_watchdog.cc
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Watchdog::~Watchdog() {
8080

8181

8282
void Watchdog::Run(void* arg) {
83+
uv_thread_setname("Watchdog");
8384
Watchdog* wd = static_cast<Watchdog*>(arg);
8485

8586
// UV_RUN_DEFAULT the loop will be stopped either by the async or the
@@ -229,9 +230,9 @@ void TraceSigintWatchdog::HandleInterrupt() {
229230

230231
#ifdef __POSIX__
231232
void* SigintWatchdogHelper::RunSigintWatchdog(void* arg) {
233+
uv_thread_setname("SigintWatchdog");
232234
// Inside the helper thread.
233235
bool is_stopping;
234-
235236
do {
236237
uv_sem_wait(&instance.sem_);
237238
is_stopping = InformWatchdogsAboutSignal();
Collapse file

‎src/tracing/agent.cc‎

Copy file name to clipboardExpand all lines: src/tracing/agent.cc
+9-4Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,15 @@ void Agent::Start() {
9494
// This thread should be created *after* async handles are created
9595
// (within NodeTraceWriter and NodeTraceBuffer constructors).
9696
// Otherwise the thread could shut down prematurely.
97-
CHECK_EQ(0, uv_thread_create(&thread_, [](void* arg) {
98-
Agent* agent = static_cast<Agent*>(arg);
99-
uv_run(&agent->tracing_loop_, UV_RUN_DEFAULT);
100-
}, this));
97+
CHECK_EQ(0,
98+
uv_thread_create(
99+
&thread_,
100+
[](void* arg) {
101+
uv_thread_setname("TraceEventWorker");
102+
Agent* agent = static_cast<Agent*>(arg);
103+
uv_run(&agent->tracing_loop_, UV_RUN_DEFAULT);
104+
},
105+
this));
101106
started_ = true;
102107
}
103108

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.