mirror of
https://github.com/latentPrion/libspinscale.git
synced 2026-04-17 14:34:25 +00:00
dbg:Gridlock detection: exclude locks where hasBeenReleased=true
This commit is contained in:
@@ -47,7 +47,8 @@ public:
|
||||
// Return list of all qutexes in predecessors' LockSets; excludes self.
|
||||
[[nodiscard]]
|
||||
std::unique_ptr<std::forward_list<std::reference_wrapper<Qutex>>>
|
||||
getAcquiredQutexHistory() const;
|
||||
getAcquiredQutexHistory(
|
||||
bool includeLocksWhichHaveBeenReleased = false) const;
|
||||
|
||||
/**
|
||||
* @brief Release a specific qutex early
|
||||
@@ -276,8 +277,8 @@ public:
|
||||
|
||||
template <class OriginalCbFnT>
|
||||
std::unique_ptr<std::forward_list<std::reference_wrapper<Qutex>>>
|
||||
SerializedAsynchronousContinuation<OriginalCbFnT>::getAcquiredQutexHistory()
|
||||
const
|
||||
SerializedAsynchronousContinuation<OriginalCbFnT>::getAcquiredQutexHistory(
|
||||
bool includeLocksWhichHaveBeenReleased) const
|
||||
{
|
||||
auto heldLocks = std::make_unique<
|
||||
std::forward_list<std::reference_wrapper<Qutex>>>();
|
||||
@@ -300,6 +301,12 @@ const
|
||||
// Add this continuation's locks to the held locks list
|
||||
for (size_t i = 0; i < heldLockSet->get().locks.size(); ++i)
|
||||
{
|
||||
if (!includeLocksWhichHaveBeenReleased
|
||||
&& heldLockSet->get().locks[i].hasBeenReleased)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
heldLocks->push_front(heldLockSet->get().locks[i].qutex);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user