Qutex: Add gridlock detection

This commit is contained in:
2025-09-29 13:38:53 -04:00
parent 6b4fe05fc0
commit 462247d743
3 changed files with 110 additions and 1 deletions
+6
View File
@@ -45,6 +45,12 @@ public:
*/
virtual void awaken(bool forceAwaken = false) = 0;
/* These two are ued to iterate through the lockset of a Lockvoker in a
* template-erased manner. We use them in the gridlock detection algorithm.
*/
virtual size_t getLockSetSize() const = 0;
virtual Qutex& getLockAt(size_t index) const = 0;
/**
* @brief Equality operator
*
@@ -175,6 +175,15 @@ public:
target->getIoService().post(*this);
}
size_t getLockSetSize() const override
{ return serializedContinuation.requiredLocks.locks.size(); }
Qutex& getLockAt(size_t index) const override
{
return serializedContinuation.requiredLocks.locks[index]
.first.get();
}
private:
// Allow awakening by resetting the awake flag
void allowAwakening()