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

Set names to runtime internal threads #75113

Merged
merged 14 commits into from
Sep 22, 2022
Prev Previous commit
Next Next commit
Add missing name for MAC
  • Loading branch information
HJLeee committed Sep 21, 2022
commit 9abb1b39537d64ea1d3fde49aa8007b426564f8d
6 changes: 5 additions & 1 deletion src/native/libs/System.Native/pal_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,12 @@ static void* SignalHandlerLoop(void* arg)
free(arg);
assert(pipeFd >= 0);

char* threadName = ".NET SigHandler";
#if defined(__linux__) || defined(__FreeBSD__)
pthread_setname_np(pthread_self(), ".NET SigHandler");
pthread_setname_np(pthread_self(), threadName);
#endif
#if defined(__APPLE__)
pthread_setname_np(threadName);
#endif

// Continually read a signal code from the signal pipe and process it,
Expand Down