Kernel: Keep alarm and vtimer queues in step with their pending interrupts

Each due alarm or vtimer queues its id next to a pending interrupt, which
pops it when it runs. An alarm cancelled with its interrupt pending was
never popped, so every later alarm interrupt found the cancelled one at
the front and was dropped: no alarm ran again. Deleting a vtimer erased
its id instead, leaving the last pending interrupt with an empty list.

Both now pop a timer that's gone when its interrupt comes, as
threads/alarm/pending and threads/vtimers/pending show the PSP still runs
the rest, in order.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-19 21:41:48 +02:00
1 parent 3ac908345c
commit d42f34d3de
4 files changed
+19 -9

No files matched your search

+5
View File
@@ -70,12 +70,17 @@ public:
bool run(PendingInterrupt& pend) override
{
u32 error;
if (triggeredAlarm.empty()) {
return false;
}
int alarmID = triggeredAlarm.front();
PSPAlarm *alarm = kernelObjects.Get<PSPAlarm>(alarmID, error);
if (error)
{
// handleResult won't run, so the alarm is popped here, or every later alarm runs this one's entry.
WARN_LOG(Log::sceKernel, "Ignoring deleted alarm %08x", alarmID);
triggeredAlarm.pop_front();
return false;
}