From dc3571a21edc8bc47b1bc45a4fead28f2c11e7b6 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 16 Oct 2018 09:18:21 -0500 Subject: [PATCH] common/AsyncReserver: Mutex -> ceph::mutex Signed-off-by: Sage Weil --- src/common/AsyncReserver.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/common/AsyncReserver.h b/src/common/AsyncReserver.h index c8c57409b4587..c955584b7c051 100644 --- a/src/common/AsyncReserver.h +++ b/src/common/AsyncReserver.h @@ -33,7 +33,7 @@ class AsyncReserver { Finisher *f; unsigned max_allowed; unsigned min_priority; - Mutex lock; + ceph::mutex lock = ceph::make_mutex("AsyncReserver::lock"); struct Reservation { T item; @@ -128,23 +128,22 @@ public: : cct(cct), f(f), max_allowed(max_allowed), - min_priority(min_priority), - lock("AsyncReserver::lock") {} + min_priority(min_priority) {} void set_max(unsigned max) { - std::lock_guard l(lock); + std::lock_guard l(lock); max_allowed = max; do_queues(); } void set_min_priority(unsigned min) { - std::lock_guard l(lock); + std::lock_guard l(lock); min_priority = min; do_queues(); } void dump(Formatter *f) { - std::lock_guard l(lock); + std::lock_guard l(lock); _dump(f); } void _dump(Formatter *f) { @@ -183,7 +182,7 @@ public: unsigned prio, ///< [in] priority Context *on_preempt = 0 ///< [in] callback to be called if we are preempted (optional) ) { - std::lock_guard l(lock); + std::lock_guard l(lock); Reservation r(item, prio, on_reserved, on_preempt); rdout(10) << __func__ << " queue " << r << dendl; ceph_assert(!queue_pointers.count(item) && @@ -204,7 +203,7 @@ public: void cancel_reservation( T item ///< [in] key for reservation to cancel ) { - std::lock_guard l(lock); + std::lock_guard l(lock); auto i = queue_pointers.find(item); if (i != queue_pointers.end()) { unsigned prio = i->second.first; @@ -240,7 +239,7 @@ public: * Return true if there are reservations in progress */ bool has_reservation() { - std::lock_guard l(lock); + std::lock_guard l(lock); return !in_progress.empty(); } static const unsigned MAX_PRIORITY = (unsigned)-1; -- 2.39.5