Lockvoker: add handleGridlock and invoke it
This commit is contained in:
@@ -159,7 +159,8 @@ public:
|
|||||||
if (!isDeadlock && !isGridlock)
|
if (!isDeadlock && !isGridlock)
|
||||||
{ return; }
|
{ return; }
|
||||||
|
|
||||||
handleDeadlock(firstFailedQutex);
|
if (isDeadlock) { handleDeadlock(firstFailedQutex); }
|
||||||
|
if (isGridlock) { handleGridlock(firstFailedQutex); }
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -308,7 +309,8 @@ public:
|
|||||||
* @brief Handle a likely deadlock situation by logging debug information
|
* @brief Handle a likely deadlock situation by logging debug information
|
||||||
* @param firstFailedQutex The first qutex that failed acquisition
|
* @param firstFailedQutex The first qutex that failed acquisition
|
||||||
*/
|
*/
|
||||||
void handleDeadlock(Qutex& firstFailedQutex);
|
void handleDeadlock(Qutex &firstFailedQutex);
|
||||||
|
void handleGridlock(Qutex &firstFailedQutex);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ template <class InvocationTargetT>
|
|||||||
void
|
void
|
||||||
SerializedAsynchronousContinuation<OriginalCbFnT>
|
SerializedAsynchronousContinuation<OriginalCbFnT>
|
||||||
::LockerAndInvoker<InvocationTargetT>
|
::LockerAndInvoker<InvocationTargetT>
|
||||||
::handleDeadlock(Qutex& firstFailedQutex)
|
::handleDeadlock(Qutex &firstFailedQutex)
|
||||||
{
|
{
|
||||||
std::cerr << __func__ << ": Deadlock: "
|
std::cerr << __func__ << ": Deadlock: "
|
||||||
<< "Lockvoker has been waiting for "
|
<< "Lockvoker has been waiting for "
|
||||||
@@ -179,6 +179,22 @@ SerializedAsynchronousContinuation<OriginalCbFnT>
|
|||||||
<< " (" << firstFailedQutex.name << ")" << std::endl;
|
<< " (" << firstFailedQutex.name << ")" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class OriginalCbFnT>
|
||||||
|
template <class InvocationTargetT>
|
||||||
|
void
|
||||||
|
SerializedAsynchronousContinuation<OriginalCbFnT>
|
||||||
|
::LockerAndInvoker<InvocationTargetT>
|
||||||
|
::handleGridlock(Qutex &firstFailedQutex)
|
||||||
|
{
|
||||||
|
std::cerr << __func__ << ": Gridlock: "
|
||||||
|
<< "Lockvoker has been waiting for "
|
||||||
|
<< std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||||
|
std::chrono::steady_clock::now() - this->creationTimestamp)
|
||||||
|
.count()
|
||||||
|
<< "ms, failed on qutex @" << &firstFailedQutex
|
||||||
|
<< " (" << firstFailedQutex.name << ")" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <class OriginalCbFnT>
|
template <class OriginalCbFnT>
|
||||||
|
|||||||
Reference in New Issue
Block a user