write thread ids to file

This commit is contained in:
Lion Kortlepel 2021-11-21 03:31:35 +01:00
parent 66d4e34a75
commit a7db41ebaa
No known key found for this signature in database
GPG Key ID: 4322FF2B4C71259B

View File

@ -121,7 +121,8 @@ void RegisterThread(const std::string& str) {
ThreadId = std::to_string(gettid());
#endif
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);
threadNameMap[std::this_thread::get_id()] = str;