Crashlog: Update thread/lock handling to match GameLoop changes
This commit is contained in:
@@ -341,6 +341,7 @@ int GetCurrentThreadName(char *str, const char *last)
|
||||
}
|
||||
|
||||
static pthread_t main_thread;
|
||||
static pthread_t game_thread;
|
||||
|
||||
void SetSelfAsMainThread()
|
||||
{
|
||||
@@ -349,6 +350,13 @@ void SetSelfAsMainThread()
|
||||
#endif
|
||||
}
|
||||
|
||||
void SetSelfAsGameThread()
|
||||
{
|
||||
#if !defined(NO_THREADS)
|
||||
game_thread = pthread_self();
|
||||
#endif
|
||||
}
|
||||
|
||||
void PerThreadSetup() { }
|
||||
|
||||
void PerThreadSetupInit() { }
|
||||
@@ -370,3 +378,12 @@ bool IsNonMainThread()
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool IsGameThread()
|
||||
{
|
||||
#if !defined(NO_THREADS)
|
||||
return game_thread == pthread_self();
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user