1
0
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:
Michał W. Urbańczyk
2011-12-03 23:40:56 +00:00
parent 3fbaaac6d9
commit 85588b6bda
17 changed files with 371 additions and 130 deletions

View File

@ -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 );