1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Replace thread spawning with tbb pool for adventure AI

This commit is contained in:
Ivan Savenko
2025-03-02 15:22:27 +00:00
parent 219eea86ff
commit a31788b874
7 changed files with 97 additions and 71 deletions

View File

@@ -21,4 +21,17 @@ 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();
class DLL_LINKAGE ScopedThreadName : boost::noncopyable
{
public:
ScopedThreadName(const std::string & name)
{
setThreadName(name);
}
~ScopedThreadName()
{
setThreadName({});
}
};
VCMI_LIB_NAMESPACE_END