Print TIDs in every new thread

This commit is contained in:
Lion Kortlepel
2020-11-03 10:22:49 +01:00
parent 2ec65d5b84
commit b2166402a2
11 changed files with 16 additions and 9 deletions

View File

@@ -10,11 +10,11 @@
#include <mutex>
#include <thread>
void DebugPrintTIDInternal(const std::string& what, const std::string& func) {
void DebugPrintTIDInternal(const std::string& func) {
// we need to print to cout here as we might crash before all console output is handled,
// due to segfaults or asserts.
#ifdef DEBUG
std::cout << "(debug build) Thread '" << std::this_thread::get_id() << "' in " << func << " is " << what << std::endl;
std::cout << "(debug build) Thread '" << std::this_thread::get_id() << "' is " << func << std::endl;
#endif // DEBUG
}