mirror of
https://github.com/latentPrion/libspinscale.git
synced 2026-04-17 22:44: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.
|
// Return list of all qutexes in predecessors' LockSets; excludes self.
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
std::unique_ptr<std::forward_list<std::reference_wrapper<Qutex>>>
|
std::unique_ptr<std::forward_list<std::reference_wrapper<Qutex>>>
|
||||||
getAcquiredQutexHistory() const;
|
getAcquiredQutexHistory(
|
||||||
|
bool includeLocksWhichHaveBeenReleased = false) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Release a specific qutex early
|
* @brief Release a specific qutex early
|
||||||
@@ -276,8 +277,8 @@ public:
|
|||||||
|
|
||||||
template <class OriginalCbFnT>
|
template <class OriginalCbFnT>
|
||||||
std::unique_ptr<std::forward_list<std::reference_wrapper<Qutex>>>
|
std::unique_ptr<std::forward_list<std::reference_wrapper<Qutex>>>
|
||||||
SerializedAsynchronousContinuation<OriginalCbFnT>::getAcquiredQutexHistory()
|
SerializedAsynchronousContinuation<OriginalCbFnT>::getAcquiredQutexHistory(
|
||||||
const
|
bool includeLocksWhichHaveBeenReleased) const
|
||||||
{
|
{
|
||||||
auto heldLocks = std::make_unique<
|
auto heldLocks = std::make_unique<
|
||||||
std::forward_list<std::reference_wrapper<Qutex>>>();
|
std::forward_list<std::reference_wrapper<Qutex>>>();
|
||||||
@@ -300,6 +301,12 @@ const
|
|||||||
// Add this continuation's locks to the held locks list
|
// Add this continuation's locks to the held locks list
|
||||||
for (size_t i = 0; i < heldLockSet->get().locks.size(); ++i)
|
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);
|
heldLocks->push_front(heldLockSet->get().locks[i].qutex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user