[wpilibj] Watchdog: handle callback throwing an exception (#8742)

Ensure mutex is re-locked.
This commit is contained in:
Peter Johnson
2026-04-10 12:29:38 -07:00
committed by GitHub
parent 3728bc3b5c
commit ea06f0b257

View File

@@ -274,8 +274,11 @@ public class Watchdog implements Closeable, Comparable<Watchdog> {
watchdog.m_isExpired = true;
m_queueMutex.unlock();
watchdog.m_callback.run();
m_queueMutex.lock();
try {
watchdog.m_callback.run();
} finally {
m_queueMutex.lock();
}
updateAlarm();
} finally {