So we can do checks like:
ceph_assert(!ceph::mutex_debugging || !ceph_mutex_is_locked_by_me(lock));
Without this boolean, this check:
ceph_assert(!ceph_mutex_is_locked_by_me(lock));
will fail for all crimson/release builds because the method always returns true.
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit
a8bd314bbd78dbe73371e7a8beaaa1929577b76e)
return {};
}
+ static constexpr bool mutex_debugging = false;
#define ceph_mutex_is_locked(m) true
#define ceph_mutex_is_locked_by_me(m) true
}
return {std::forward<Args>(args)...};
}
+ static constexpr bool mutex_debugging = true;
+
// debug methods
#define ceph_mutex_is_locked(m) ((m).is_locked())
#define ceph_mutex_is_not_locked(m) (!(m).is_locked())
return {};
}
+ static constexpr bool mutex_debugging = false;
+
// debug methods. Note that these can blindly return true
// because any code that does anything other than assert these
// are true is broken.