// debug (lockdep-capable, various sanity checks and asserts)
// ============================================================================
-#include "common/mutex_debug.h"
#include "common/condition_variable_debug.h"
+#include "common/mutex_debug.h"
+#include "common/shared_mutex_debug.h"
namespace ceph {
typedef ceph::mutex_debug mutex;
typedef ceph::mutex_recursive_debug recursive_mutex;
typedef ceph::condition_variable_debug condition_variable;
+ typedef ceph::shared_mutex_debug shared_mutex;
// pass arguments to mutex_debug ctor
template <typename ...Args>
return {std::forward<Args>(args)...};
}
+ // pass arguments to shared_mutex_debug ctor
+ template <typename ...Args>
+ shared_mutex make_shared_mutex(Args&& ...args) {
+ return {std::forward<Args>(args)...};
+ }
+
// debug methods
#define ceph_mutex_is_locked(m) ((m).is_locked())
#define ceph_mutex_is_locked_by_me(m) ((m).is_locked_by_me())
// release (fast and minimal)
// ============================================================================
-#include <mutex>
#include <condition_variable>
+#include <mutex>
+#include <shared_mutex>
+
namespace ceph {
typedef std::mutex mutex;
typedef std::recursive_mutex recursive_mutex;
typedef std::condition_variable condition_variable;
+ typedef std::shared_mutex shared_mutex;
// discard arguments to make_mutex (they are for debugging only)
template <typename ...Args>
std::recursive_mutex make_recursive_mutex(Args&& ...args) {
return {};
}
+ template <typename ...Args>
+ std::shared_mutex make_shared_mutex(Args&& ...args) {
+ return {};
+ }
// debug methods. Note that these can blindly return true
// because any code that does anything other than assert these