mirror of
https://github.com/PabloMK7/citra.git
synced 2025-10-11 20:10:03 +00:00
Add random sleep to game main thread on first boot when using LLE modules (#7199)
* Add random delay to app main thread * Suggestions * Remove randomness, only delay with lle * Apply suggestions * Fix clang format * Fix compilation (again) * Remove unused include
This commit is contained in:
parent
f346949989
commit
a177769c3b
9 changed files with 87 additions and 6 deletions
|
@ -214,10 +214,20 @@ static bool AttemptLLE(const ServiceModuleInfo& service_module) {
|
|||
/// Initialize ServiceManager
|
||||
void Init(Core::System& core) {
|
||||
SM::ServiceManager::InstallInterfaces(core);
|
||||
core.Kernel().SetAppMainThreadExtendedSleep(false);
|
||||
bool lle_module_present = false;
|
||||
|
||||
for (const auto& service_module : service_module_map) {
|
||||
if (!AttemptLLE(service_module) && service_module.init_function != nullptr)
|
||||
const bool has_lle = AttemptLLE(service_module);
|
||||
if (!has_lle && service_module.init_function != nullptr) {
|
||||
service_module.init_function(core);
|
||||
}
|
||||
lle_module_present |= has_lle;
|
||||
}
|
||||
if (lle_module_present) {
|
||||
// If there is at least one LLE module, tell the kernel to
|
||||
// add a extended sleep to the app main thread (if option enabled).
|
||||
core.Kernel().SetAppMainThreadExtendedSleep(true);
|
||||
}
|
||||
LOG_DEBUG(Service, "initialized OK");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue