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