mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-27 13:14:15 -04:00
ProcessManager: Fix svcCreateEvent handle inversion bug, and others.
NOTE: Debugging logs have been left in, and will be cleaned up once PM is working.
This commit is contained in:
parent
6e5d4b8fc9
commit
6d6ecb503a
8 changed files with 81 additions and 35 deletions
|
@ -2,15 +2,26 @@
|
|||
#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(U64_MAX);
|
||||
process_waiter->add_waitable(Registration::GetProcessLaunchStartEvent());
|
||||
WaitableManager *process_waiter = new WaitableManager(1000);
|
||||
process_waiter->add_waitable(Registration::GetProcessList());
|
||||
|
||||
|
||||
static unsigned int i = 0;
|
||||
/* Service processes. */
|
||||
process_waiter->process();
|
||||
while (true) {
|
||||
process_waiter->process_until_timeout();
|
||||
|
||||
i++;
|
||||
if (Registration::TryWaitProcessLaunchStartEvent()) {
|
||||
Registration::HandleProcessLaunch();
|
||||
}
|
||||
if (i > 1000000) {
|
||||
Reboot();
|
||||
}
|
||||
}
|
||||
|
||||
delete process_waiter;
|
||||
svcExitThread();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue