Fix thread name setting

We utilize `pthread_setname_np` to set the thread names but didn't check for any errors which resulted in the `Skyline-Choreographer` and `ChannelCmdFifo` not having proper names as they exceeded the 16 character limit on thread names for the pthread function.  This has now been fixed by changing the names and introducing error checking to invocations of this function.
This commit is contained in:
PixelyIon
2022-06-09 22:10:44 +05:30
parent 7a0cfb484c
commit 6e09dc5204
4 changed files with 16 additions and 8 deletions

View File

@ -65,7 +65,9 @@ namespace skyline::gpu {
}
void PresentationEngine::ChoreographerThread() {
pthread_setname_np(pthread_self(), "Skyline-Choreographer");
if (int result{pthread_setname_np(pthread_self(), "Sky-Choreo")})
Logger::Warn("Failed to set the thread name: {}", strerror(result));
try {
signal::SetSignalHandler({SIGINT, SIGILL, SIGTRAP, SIGBUS, SIGFPE, SIGSEGV}, signal::ExceptionalSignalHandler);
choreographerLooper = ALooper_prepare(0);