mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Avoid remote server timing out if starting android packages.
* Android::StartAndroidPackageForCapture can take a long time, and we want to preserve the connection, so we spin up a temporary thread to continually Ping().
This commit is contained in:
@@ -1218,7 +1218,25 @@ public:
|
||||
{
|
||||
const char *host = hostname().c_str();
|
||||
if(Android::IsHostADB(host))
|
||||
return Android::StartAndroidPackageForCapture(host, a);
|
||||
{
|
||||
// we spin up a thread to Ping() every second, since StartAndroidPackageForCapture can block
|
||||
// for a long time.
|
||||
volatile int32_t done = 0;
|
||||
Threading::ThreadHandle pingThread = Threading::CreateThread([&done, this]() {
|
||||
bool ok = true;
|
||||
while(ok && Atomic::CmpExch32(&done, 0, 0) == 0)
|
||||
ok = Ping();
|
||||
});
|
||||
|
||||
uint32_t ret = Android::StartAndroidPackageForCapture(host, a);
|
||||
|
||||
Atomic::Inc32(&done);
|
||||
|
||||
Threading::JoinThread(pingThread);
|
||||
Threading::CloseThread(pingThread);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string app = a && a[0] ? a : "";
|
||||
std::string workingDir = w && w[0] ? w : "";
|
||||
|
||||
Reference in New Issue
Block a user