Qutex: Add gridlock detection
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user