Give our threads debugger-friendly names

This commit is contained in:
baldurk
2019-12-19 21:50:13 +00:00
parent 2620f0bb8c
commit 27098f8f70
20 changed files with 174 additions and 0 deletions
+4
View File
@@ -696,6 +696,8 @@ struct AndroidController : public IDeviceProtocolHandler
void ThreadEntry()
{
Threading::SetCurrentThreadName("AndroidController");
while(Atomic::CmpExch32(&running, 1, 1) == 1)
{
Threading::Sleep(5);
@@ -956,6 +958,8 @@ ExecuteResult AndroidRemoteServer::ExecuteAndInject(const char *a, const char *w
// we spin up a thread to Ping() every second, since starting a package can block for a long time.
volatile int32_t done = 0;
Threading::ThreadHandle pingThread = Threading::CreateThread([&done, this]() {
Threading::SetCurrentThreadName("Android Ping");
bool ok = true;
while(ok && Atomic::CmpExch32(&done, 0, 0) == 0)
ok = Ping();