mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-03 00:46:55 +02:00
[programming challenge]
* stupid AI will print more info * proper handling of too long processing of battle end calls * doxygenized some comments
This commit is contained in:
@ -49,8 +49,10 @@ void CThreadHelper::processTasks()
|
||||
}
|
||||
}
|
||||
|
||||
static std::list<std::string> names;
|
||||
void setThreadName(long threadID, const std::string &name)
|
||||
{
|
||||
names.push_back(name);
|
||||
#ifdef _WIN32
|
||||
//follows http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx
|
||||
const DWORD MS_VC_EXCEPTION=0x406D1388;
|
||||
@ -65,10 +67,12 @@ void setThreadName(long threadID, const std::string &name)
|
||||
#pragma pack(pop)
|
||||
THREADNAME_INFO info;
|
||||
info.dwType = 0x1000;
|
||||
info.szName = name.c_str();
|
||||
info.szName = names.back().c_str();
|
||||
info.dwThreadID = threadID;
|
||||
info.dwFlags = 0;
|
||||
|
||||
tlog5 << "Thread " << GetCurrentThreadId() << " will be known as " << name << std::endl;
|
||||
|
||||
__try
|
||||
{
|
||||
RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info );
|
||||
|
Reference in New Issue
Block a user