mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
impr: Make ImHex not use lots of CPU when waiting for conditions
This commit is contained in:
@@ -16,9 +16,10 @@ namespace hex::plugin::builtin {
|
||||
|
||||
void handleNetworkInterfaceService() {
|
||||
if (!networkInterfaceServiceEnabled) {
|
||||
std::this_thread::yield();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
return;
|
||||
}
|
||||
|
||||
static wolv::net::SocketServer networkInterfaceServer(31337);
|
||||
networkInterfaceServer.accept([](auto, const std::vector<u8> &data) -> std::vector<u8> {
|
||||
nlohmann::json result;
|
||||
|
||||
@@ -880,7 +880,7 @@ namespace hex::plugin::builtin {
|
||||
*this->m_breakpointHit = true;
|
||||
this->m_resetDebuggerVariables = true;
|
||||
while (*this->m_breakpointHit) {
|
||||
std::this_thread::yield();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -900,7 +900,7 @@ namespace hex::plugin::builtin {
|
||||
this->m_dangerousFunctionCalled = true;
|
||||
|
||||
while (this->m_dangerousFunctionsAllowed == DangerousFunctionPerms::Ask) {
|
||||
std::this_thread::yield();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
}
|
||||
|
||||
return this->m_dangerousFunctionsAllowed == DangerousFunctionPerms::Allow;
|
||||
|
||||
Reference in New Issue
Block a user