LockSet:tryAcquireOrBackoff use optional<ref_wrapper<Qutex>>
Replace the previous Qutex** raw pointer with a std::optional.
This commit is contained in:
@@ -107,14 +107,12 @@ public:
|
||||
"executing on wrong ComponentThread");
|
||||
}
|
||||
|
||||
Qutex *firstFailedQutexPtr = nullptr;
|
||||
std::optional<std::reference_wrapper<Qutex>> firstFailedQutexRet;
|
||||
bool deadlockLikely = isDeadlockLikely();
|
||||
bool gridlockLikely = isGridlockLikely();
|
||||
|
||||
if (!serializedContinuation.requiredLocks.tryAcquireOrBackOff(
|
||||
*this,
|
||||
((deadlockLikely || gridlockLikely)
|
||||
? &firstFailedQutexPtr : nullptr)))
|
||||
*this, firstFailedQutexRet))
|
||||
{
|
||||
// Just allow this lockvoker to be dropped from its io_service.
|
||||
allowAwakening();
|
||||
@@ -122,7 +120,7 @@ public:
|
||||
{ return; }
|
||||
|
||||
#ifdef CONFIG_ENABLE_DEBUG_LOCKS
|
||||
Qutex &firstFailedQutex = *firstFailedQutexPtr;
|
||||
Qutex &firstFailedQutex = firstFailedQutexRet.value().get();
|
||||
bool isDeadlock = traceContinuationHistoryForDeadlockOn(
|
||||
firstFailedQutex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user