mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-01-19 04:13:24 +00:00
Core: Set thread names when possible.
This doesn't seem to be working for lldb, though.
This commit is contained in:
parent
95bcda409d
commit
062566b67c
@ -35,6 +35,7 @@ SDLJoystick *joystick = NULL;
|
||||
#include "util/text/parsers.h"
|
||||
#include "math/math_util.h"
|
||||
#include "thin3d/GLRenderManager.h"
|
||||
#include "thread/threadutil.h"
|
||||
#include "Common/Vulkan/VulkanContext.h"
|
||||
#include "Common/Vulkan/VulkanDebug.h"
|
||||
#include "math.h"
|
||||
@ -725,6 +726,8 @@ static std::thread emuThread;
|
||||
static std::atomic<int> emuThreadState((int)EmuThreadState::DISABLED);
|
||||
|
||||
static void EmuThreadFunc() {
|
||||
setCurrentThreadName("Emu");
|
||||
|
||||
// There's no real requirement that NativeInit happen on this thread.
|
||||
// We just call the update/render loop here.
|
||||
emuThreadState = (int)EmuThreadState::RUNNING;
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "base/logging.h"
|
||||
#include "thread/threadutil.h"
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#if defined(__ANDROID__) || defined(__APPLE__) || (defined(__GLIBC__) && defined(_GNU_SOURCE))
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
@ -96,10 +96,12 @@ void setCurrentThreadName(const char* threadName) {
|
||||
{}
|
||||
#else
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
#if defined(__ANDROID__) || (defined(__GLIBC__) && defined(_GNU_SOURCE))
|
||||
pthread_setname_np(pthread_self(), threadName);
|
||||
#elif defined(__APPLE__)
|
||||
pthread_setname_np(threadName);
|
||||
// #else
|
||||
// pthread_setname_np(thread_name);
|
||||
// pthread_setname_np(threadName);
|
||||
#endif
|
||||
|
||||
// Do nothing
|
||||
|
Loading…
x
Reference in New Issue
Block a user