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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user