Locking: Add basic reactive deadlock detection foundation

We added a timestamp to each Lockvoker so that we can detect when
a lockvoker has been in a qutex for "too long", where "too long"
is defined arbitrarily as 500ms.

Next we're going to change the way we create callbacks to enable
us to more explicitly access the sh_ptr<AsyncContin> via
the callback object.
This commit is contained in:
2025-09-22 20:45:36 -04:00
parent d2ed525106
commit 092a0954a0
5 changed files with 53 additions and 31 deletions
+10 -3
View File
@@ -1,6 +1,7 @@
#ifndef QUTEX_H
#define QUTEX_H
#include <config.h>
#include <list>
#include <atomic>
#include <memory>
@@ -24,8 +25,12 @@ public:
/**
* @brief Constructor
*/
Qutex(const std::string &_name)
: isOwned(false), name(_name)
Qutex([[maybe_unused]] const std::string &_name)
:
#ifdef CONFIG_ENABLE_DEBUG_LOCKS
name(_name),
#endif
isOwned(false)
{}
/**
@@ -85,10 +90,12 @@ public:
void release();
public:
#ifdef CONFIG_ENABLE_DEBUG_LOCKS
std::string name;
#endif
SpinLock lock;
LockerAndInvokerBase::List queue;
bool isOwned;
std::string name;
};
} // namespace smo