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 "util/text/parsers.h"
|
||||||
#include "math/math_util.h"
|
#include "math/math_util.h"
|
||||||
#include "thin3d/GLRenderManager.h"
|
#include "thin3d/GLRenderManager.h"
|
||||||
|
#include "thread/threadutil.h"
|
||||||
#include "Common/Vulkan/VulkanContext.h"
|
#include "Common/Vulkan/VulkanContext.h"
|
||||||
#include "Common/Vulkan/VulkanDebug.h"
|
#include "Common/Vulkan/VulkanDebug.h"
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
@ -725,6 +726,8 @@ static std::thread emuThread;
|
|||||||
static std::atomic<int> emuThreadState((int)EmuThreadState::DISABLED);
|
static std::atomic<int> emuThreadState((int)EmuThreadState::DISABLED);
|
||||||
|
|
||||||
static void EmuThreadFunc() {
|
static void EmuThreadFunc() {
|
||||||
|
setCurrentThreadName("Emu");
|
||||||
|
|
||||||
// There's no real requirement that NativeInit happen on this thread.
|
// There's no real requirement that NativeInit happen on this thread.
|
||||||
// We just call the update/render loop here.
|
// We just call the update/render loop here.
|
||||||
emuThreadState = (int)EmuThreadState::RUNNING;
|
emuThreadState = (int)EmuThreadState::RUNNING;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "thread/threadutil.h"
|
#include "thread/threadutil.h"
|
||||||
|
|
||||||
#ifdef __ANDROID__
|
#if defined(__ANDROID__) || defined(__APPLE__) || (defined(__GLIBC__) && defined(_GNU_SOURCE))
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -96,10 +96,12 @@ void setCurrentThreadName(const char* threadName) {
|
|||||||
{}
|
{}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if defined(__ANDROID__)
|
#if defined(__ANDROID__) || (defined(__GLIBC__) && defined(_GNU_SOURCE))
|
||||||
pthread_setname_np(pthread_self(), threadName);
|
pthread_setname_np(pthread_self(), threadName);
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
pthread_setname_np(threadName);
|
||||||
// #else
|
// #else
|
||||||
// pthread_setname_np(thread_name);
|
// pthread_setname_np(threadName);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Do nothing
|
// Do nothing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user