mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilibj] Watchdog: handle callback throwing an exception (#8742)
Ensure mutex is re-locked.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user