31 lines
816 B
C++
31 lines
816 B
C++
|
|
#include <config.h>
|
||
|
|
#include <serializedAsynchronousContinuation.h>
|
||
|
|
#include <qutex.h>
|
||
|
|
|
||
|
|
namespace smo {
|
||
|
|
|
||
|
|
#ifdef CONFIG_ENABLE_DEBUG_LOCKS
|
||
|
|
template <class OriginalCbFnT>
|
||
|
|
template <class InvocationTargetT>
|
||
|
|
void
|
||
|
|
SerializedAsynchronousContinuation<OriginalCbFnT>
|
||
|
|
::LockerAndInvoker<InvocationTargetT>
|
||
|
|
::handleLikelyDeadlock(Qutex& firstFailedQutex)
|
||
|
|
{
|
||
|
|
std::cerr << __func__ << ": Deadlock likely: "
|
||
|
|
<< "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
|
||
|
|
|
||
|
|
// Explicit template instantiations for the types we need
|
||
|
|
// Add more as needed for your specific use cases
|
||
|
|
|
||
|
|
} // namespace smo
|