Thread: Adjust checks for whether current thread is the game thread
This commit is contained in:
@@ -223,3 +223,4 @@ void PerThreadSetupInit() { }
|
||||
bool IsMainThread() { return false; }
|
||||
bool IsNonMainThread() { return false; }
|
||||
bool IsGameThread() { return false; }
|
||||
bool IsNonGameThread() { return false; }
|
||||
|
@@ -380,6 +380,15 @@ bool IsGameThread()
|
||||
{
|
||||
#if !defined(NO_THREADS)
|
||||
return game_thread == pthread_self();
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool IsNonGameThread()
|
||||
{
|
||||
#if !defined(NO_THREADS)
|
||||
return game_thread != pthread_self();
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
@@ -757,6 +757,11 @@ bool IsGameThread()
|
||||
return game_thread_id == GetCurrentThreadId();
|
||||
}
|
||||
|
||||
bool IsNonGameThread()
|
||||
{
|
||||
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