LockSet:tryAcquireOrBackoff use optional<ref_wrapper<Qutex>>

Replace the previous Qutex** raw pointer with a std::optional.
This commit is contained in:
2025-09-30 10:36:19 -04:00
parent e3ce533fe4
commit f15c07bc83
3 changed files with 10 additions and 10 deletions
+3 -4
View File
@@ -44,7 +44,8 @@ void LockSet<OriginalCbFnT>::registerInQutexQueues(
template <class OriginalCbFnT>
bool LockSet<OriginalCbFnT>::tryAcquireOrBackOff(
LockerAndInvokerBase &lockvoker, Qutex **firstFailedQutex
LockerAndInvokerBase &lockvoker,
std::optional<std::reference_wrapper<Qutex>> &firstFailedQutex
)
{
if (!registeredInQutexQueues)
@@ -71,9 +72,7 @@ bool LockSet<OriginalCbFnT>::tryAcquireOrBackOff(
lockvoker, nRequiredLocks))
{
// Set the first failed qutex for debugging
if (firstFailedQutex) {
*firstFailedQutex = &lockUsageDesc.first.get();
}
firstFailedQutex = std::ref(lockUsageDesc.first.get());
break;
}