mirror of
https://github.com/DarkMatterCore/nxdumptool.git
synced 2024-11-26 12:12:02 +00:00
poc: add small sleep to all while() loops.
This commit is contained in:
parent
55d744b5c2
commit
54e7c0e9be
1 changed files with 9 additions and 2 deletions
|
@ -933,6 +933,8 @@ int main(int argc, char *argv[])
|
||||||
data_update = true;
|
data_update = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
svcSleepThread(50000000); // 50 ms
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_appletStatus) break;
|
if (!g_appletStatus) break;
|
||||||
|
@ -1193,7 +1195,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (btn_held & (HidNpadButton_StickLDown | HidNpadButton_StickRDown | HidNpadButton_StickLUp | HidNpadButton_StickRUp | HidNpadButton_ZL | HidNpadButton_ZR)) svcSleepThread(50000000); // 50 ms
|
svcSleepThread(50000000); // 50 ms
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
@ -1239,6 +1241,7 @@ static void utilsWaitForButtonPress(u64 flag)
|
||||||
{
|
{
|
||||||
utilsScanPads();
|
utilsScanPads();
|
||||||
if (utilsGetButtonsDown() & flag) break;
|
if (utilsGetButtonsDown() & flag) break;
|
||||||
|
svcSleepThread(50000000); // 50 ms
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2342,7 +2345,7 @@ static bool saveNintendoSubmissionPackage(void *userdata)
|
||||||
utilsCreateThread(&dump_thread, nspThreadFunc, &nsp_thread_data, 2);
|
utilsCreateThread(&dump_thread, nspThreadFunc, &nsp_thread_data, 2);
|
||||||
|
|
||||||
/* Wait until the background thread calculates the NSP size. */
|
/* Wait until the background thread calculates the NSP size. */
|
||||||
while(!nsp_thread_data.total_size && !nsp_thread_data.error) svcSleepThread(10000000); // 10 ms
|
while(!nsp_thread_data.total_size && !nsp_thread_data.error) svcSleepThread(50000000); // 50 ms
|
||||||
|
|
||||||
if (nsp_thread_data.error)
|
if (nsp_thread_data.error)
|
||||||
{
|
{
|
||||||
|
@ -2403,6 +2406,8 @@ static bool saveNintendoSubmissionPackage(void *userdata)
|
||||||
|
|
||||||
consolePrint("%lu / %lu (%u%%) | Time elapsed: %lu\n", size, nsp_thread_data.total_size, percent, (now - start));
|
consolePrint("%lu / %lu (%u%%) | Time elapsed: %lu\n", size, nsp_thread_data.total_size, percent, (now - start));
|
||||||
consoleRefresh();
|
consoleRefresh();
|
||||||
|
|
||||||
|
svcSleepThread(50000000); // 50 ms
|
||||||
}
|
}
|
||||||
|
|
||||||
consolePrint("\nwaiting for thread to join\n");
|
consolePrint("\nwaiting for thread to join\n");
|
||||||
|
@ -3208,6 +3213,8 @@ static bool spanDumpThreads(ThreadFunc read_func, ThreadFunc write_func, void *a
|
||||||
|
|
||||||
consolePrint("%lu / %lu (%u%%) | Time elapsed: %lu\n", size, shared_thread_data->total_size, percent, (now - start));
|
consolePrint("%lu / %lu (%u%%) | Time elapsed: %lu\n", size, shared_thread_data->total_size, percent, (now - start));
|
||||||
consoleRefresh();
|
consoleRefresh();
|
||||||
|
|
||||||
|
svcSleepThread(50000000); // 50 ms
|
||||||
}
|
}
|
||||||
|
|
||||||
consolePrint("\nwaiting for threads to join\n");
|
consolePrint("\nwaiting for threads to join\n");
|
||||||
|
|
Loading…
Reference in a new issue