7 * T - node type. needs to implement is_lock_owner()
9 template <typename Scope, typename T>
10 class ownership_checker {
15 MyLockedNodes(true)->clear();
18 // is used to signal the end of a tuple lock region
20 AssertAllNodeLocksReleased()
22 std::vector<const T *> *nodes = MyLockedNodes(false);
25 ALWAYS_ASSERT(!p->is_lock_owner());
30 AddNodeToLockRegion(const T *n)
32 ALWAYS_ASSERT(n->is_locked());
33 ALWAYS_ASSERT(n->is_lock_owner());
34 std::vector<const T *> *nodes = MyLockedNodes(false);
40 static std::vector<const T *> *
41 MyLockedNodes(bool create)
43 static __thread std::vector<const T *> *tl_locked_nodes = nullptr;
44 if (unlikely(!tl_locked_nodes) && create)
45 tl_locked_nodes = new std::vector<const T *>;
46 return tl_locked_nodes;