Crashlog: Update thread/lock handling to match GameLoop changes
This commit is contained in:
@@ -734,12 +734,18 @@ int OTTDStringCompare(const char *s1, const char *s2)
|
||||
}
|
||||
|
||||
static DWORD main_thread_id;
|
||||
static DWORD game_thread_id;
|
||||
|
||||
void SetSelfAsMainThread()
|
||||
{
|
||||
main_thread_id = GetCurrentThreadId();
|
||||
}
|
||||
|
||||
void SetSelfAsGameThread()
|
||||
{
|
||||
game_thread_id = GetCurrentThreadId();
|
||||
}
|
||||
|
||||
static BOOL (WINAPI *_SetThreadStackGuarantee)(PULONG) = nullptr;
|
||||
|
||||
void PerThreadSetup()
|
||||
@@ -765,6 +771,11 @@ bool IsNonMainThread()
|
||||
return main_thread_id != GetCurrentThreadId();
|
||||
}
|
||||
|
||||
bool IsGameThread()
|
||||
{
|
||||
return game_thread_id == GetCurrentThreadId();
|
||||
}
|
||||
|
||||
static std::map<DWORD, std::string> _thread_name_map;
|
||||
static std::mutex _thread_name_map_mutex;
|
||||
|
||||
|
Reference in New Issue
Block a user