Debug:Qutex: Add deadlock detection based on elapsed time

We now detect that a deadlock is likely when
CONFIG_DEBUG_QUTEX_DEADLOCK_TIMEOUT_MS has elapsed. This is the
preliminary work required to do a backtrace through the call
stack and figure out if a deadlock has really occured.

To do this, we'd have to go through the async call chain and
search for a previous caller which acquired the same qutex as
the one that first failed during this Lockvoker LockSet acquisition
attempt.
This commit is contained in:
2025-09-21 15:11:28 -04:00
parent dbc9569775
commit d2ed525106
6 changed files with 59 additions and 9 deletions
+4 -1
View File
@@ -81,9 +81,12 @@ public:
/**
* @brief Try to acquire all locks in order; back off if acquisition fails
* @param lockvoker The LockerAndInvoker attempting to acquire the locks
* @param firstFailedQutex Output parameter to receive the first Qutex that
* failed acquisition (can be nullptr)
* @return true if all locks were acquired, false otherwise
*/
bool tryAcquireOrBackOff(LockerAndInvokerBase &lockvoker);
bool tryAcquireOrBackOff(
LockerAndInvokerBase &lockvoker, Qutex *firstFailedQutex = nullptr);
void unregisterFromQutexQueues();
/**