1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-27 14:22:17 +00:00
Atmosphere/stratosphere/pm/source/pm_process_track.cpp
Michael Scire 6d6ecb503a ProcessManager: Fix svcCreateEvent handle inversion bug, and others.
NOTE: Debugging logs have been left in, and will be cleaned up once PM
is working.
2018-05-06 02:23:47 -06:00

28 lines
No EOL
745 B
C++

#include <switch.h>
#include <stratosphere.hpp>
#include "pm_process_track.hpp"
#include "pm_registration.hpp"
#include "pm_debug.hpp"
void ProcessTracking::MainLoop(void *arg) {
/* Make a new waitable manager. */
WaitableManager *process_waiter = new WaitableManager(1000);
process_waiter->add_waitable(Registration::GetProcessList());
static unsigned int i = 0;
/* Service processes. */
while (true) {
process_waiter->process_until_timeout();
i++;
if (Registration::TryWaitProcessLaunchStartEvent()) {
Registration::HandleProcessLaunch();
}
if (i > 1000000) {
Reboot();
}
}
delete process_waiter;
svcExitThread();
}