Skip to content

Commit

Permalink
Merge pull request #4313 from pmatos/StartupSleepname
Browse files Browse the repository at this point in the history
Add option StartupSleepProcName
  • Loading branch information
Sonicadvance1 authored Jan 30, 2025
2 parents db7fb56 + 28170fd commit 55cbb0b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions FEXCore/Source/Interface/Config/Config.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,13 @@
"Sleeps the process at startup for a duration of seconds.",
"Useful if an application crashes too quickly to attach a debugger."
]
},
"StartupSleepProcName": {
"Type": "str",
"Default": "",
"Desc": [
"Contrains the startup sleep to only apply to processes that match this name."
]
}
},
"Misc": {
Expand Down
3 changes: 2 additions & 1 deletion Source/Tools/FEXLoader/FEXLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ int main(int argc, char** argv, char** const envp) {
// Doesn't use CONFIG_ROOTFS and we don't want it to spin up a squashfs instance
FEX_CONFIG_OPT(StallProcess, STALLPROCESS);
FEX_CONFIG_OPT(StartupSleep, STARTUPSLEEP);
FEX_CONFIG_OPT(StartupSleepProcName, STARTUPSLEEPPROCNAME);
if (StallProcess) {
while (1) {
// Stall this process out forever
Expand Down Expand Up @@ -409,7 +410,7 @@ int main(int argc, char** argv, char** const envp) {
}
}

if (StartupSleep()) {
if (StartupSleep() && (StartupSleepProcName().empty() || Program.ProgramName == StartupSleepProcName())) {
LogMan::Msg::IFmt("[{}][{}] Sleeping for {} seconds", ::getpid(), Program.ProgramName, StartupSleep());
std::this_thread::sleep_for(std::chrono::seconds(StartupSleep()));
}
Expand Down

0 comments on commit 55cbb0b

Please sign in to comment.