Locking: Add basic reactive deadlock detection foundation
We added a timestamp to each Lockvoker so that we can detect when a lockvoker has been in a qutex for "too long", where "too long" is defined arbitrarily as 500ms. Next we're going to change the way we create callbacks to enable us to more explicitly access the sh_ptr<AsyncContin> via the callback object.
This commit is contained in:
+10
-3
@@ -1,6 +1,7 @@
|
||||
#ifndef QUTEX_H
|
||||
#define QUTEX_H
|
||||
|
||||
#include <config.h>
|
||||
#include <list>
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
@@ -24,8 +25,12 @@ public:
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
Qutex(const std::string &_name)
|
||||
: isOwned(false), name(_name)
|
||||
Qutex([[maybe_unused]] const std::string &_name)
|
||||
:
|
||||
#ifdef CONFIG_ENABLE_DEBUG_LOCKS
|
||||
name(_name),
|
||||
#endif
|
||||
isOwned(false)
|
||||
{}
|
||||
|
||||
/**
|
||||
@@ -85,10 +90,12 @@ public:
|
||||
void release();
|
||||
|
||||
public:
|
||||
#ifdef CONFIG_ENABLE_DEBUG_LOCKS
|
||||
std::string name;
|
||||
#endif
|
||||
SpinLock lock;
|
||||
LockerAndInvokerBase::List queue;
|
||||
bool isOwned;
|
||||
std::string name;
|
||||
};
|
||||
|
||||
} // namespace smo
|
||||
|
||||
Reference in New Issue
Block a user