write thread ids to file

This commit is contained in:
Lion Kortlepel
2021-11-21 03:31:35 +01:00
parent 66d4e34a75
commit a7db41ebaa
+2 -1
View File
@@ -121,7 +121,8 @@ void RegisterThread(const std::string& str) {
ThreadId = std::to_string(gettid()); ThreadId = std::to_string(gettid());
#endif #endif
if (Application::Settings.DebugModeEnabled) { if (Application::Settings.DebugModeEnabled) {
std::cout << ("Thread \"" + str + "\" is TID " + ThreadId) << std::endl; std::ofstream ThreadFile("Threads.log", std::ios::app);
ThreadFile << ("Thread \"" + str + "\" is TID " + ThreadId) << std::endl;
} }
auto Lock = std::unique_lock(ThreadNameMapMutex); auto Lock = std::unique_lock(ThreadNameMapMutex);
threadNameMap[std::this_thread::get_id()] = str; threadNameMap[std::this_thread::get_id()] = str;