From 274edc10138128281eb93d76b630ddd9cc86ed40 Mon Sep 17 00:00:00 2001 From: Hayodea Hekol Date: Mon, 29 Sep 2025 20:47:04 -0400 Subject: [PATCH] QtxHistTracker: Print message on heuristic gridlock find --- smocore/qutexAcquisitionHistoryTracker.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/smocore/qutexAcquisitionHistoryTracker.cpp b/smocore/qutexAcquisitionHistoryTracker.cpp index a00b29e..775a579 100644 --- a/smocore/qutexAcquisitionHistoryTracker.cpp +++ b/smocore/qutexAcquisitionHistoryTracker.cpp @@ -4,6 +4,7 @@ #include #include #include +#include namespace smo { @@ -125,11 +126,18 @@ bool QutexAcquisitionHistoryTracker /* Found firstFailedQutex in another continuation's held locks * This indicates a potential gridlock */ - if (&heldLock.get() == &firstFailedQutex) - { - acquisitionHistoryLock.release(); - return true; - } + if (&heldLock.get() != &firstFailedQutex) + { continue; } + + acquisitionHistoryLock.release(); + + std::cerr << __func__ << ": GRIDLOCK DETECTED: Current " + "continuation @" << currentContinuation.get() + << " wants lock '" << firstFailedQutex.name + << "' which is held by continuation @" + << continuation.get() << std::endl; + + return true; } }