1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

Show human-readable thread name in log

This commit is contained in:
Ivan Savenko
2024-02-11 16:11:21 +02:00
parent 0fc0ad238b
commit cded8b1999
6 changed files with 44 additions and 13 deletions

View File

@ -85,7 +85,14 @@ private:
}
};
/// Sets thread name that will be used for both logs and debugger (if supported)
/// WARNING: on Unix-like systems this method should not be used for main thread since it will also change name of the process
void DLL_LINKAGE setThreadName(const std::string &name);
/// Sets thread name for use in logging only
void DLL_LINKAGE setThreadNameLoggingOnly(const std::string &name);
/// Returns human-readable thread name that was set before, or string form of system-provided thread ID if no human-readable name was set
std::string DLL_LINKAGE getThreadName();
VCMI_LIB_NAMESPACE_END