[hal] Notifier: Reset signal object on ack (#8466)

This is needed to avoid spurious wakeups in WaitForObject due to a
previous alarm having set the signal object.
This commit is contained in:
Peter Johnson
2025-12-11 23:31:49 -07:00
committed by GitHub
parent 5aaf2d7138
commit cbe447aad7
2 changed files with 6 additions and 0 deletions

View File

@@ -185,6 +185,7 @@ void HAL_SetNotifierAlarm(HAL_NotifierHandle notifierHandle, uint64_t alarmTime,
if (ack) {
notifier->handlerSignaled.clear();
wpi::util::ResetSignalObject(notifierHandle);
}
if (!absolute) {
@@ -217,6 +218,7 @@ void HAL_CancelNotifierAlarm(HAL_NotifierHandle notifierHandle, HAL_Bool ack,
if (ack) {
notifier->handlerSignaled.clear();
wpi::util::ResetSignalObject(notifierHandle);
}
thr->m_alarmQueue.remove({notifierHandle, notifier});
@@ -231,6 +233,7 @@ void HAL_AcknowledgeNotifierAlarm(HAL_NotifierHandle notifierHandle,
return;
}
notifier->handlerSignaled.clear();
wpi::util::ResetSignalObject(notifierHandle);
}
int32_t HAL_GetNotifierOverrun(HAL_NotifierHandle notifierHandle,