CThreadHelper.h 852 B

123456789101112131415161718192021222324
  1. /*
  2. * CThreadHelper.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. VCMI_LIB_NAMESPACE_BEGIN
  12. /// Sets thread name that will be used for both logs and debugger (if supported)
  13. /// WARNING: on Unix-like systems this method should not be used for main thread since it will also change name of the process
  14. void DLL_LINKAGE setThreadName(const std::string &name);
  15. /// Sets thread name for use in logging only
  16. void DLL_LINKAGE setThreadNameLoggingOnly(const std::string &name);
  17. /// Returns human-readable thread name that was set before, or string form of system-provided thread ID if no human-readable name was set
  18. std::string DLL_LINKAGE getThreadName();
  19. VCMI_LIB_NAMESPACE_END