From: Sage Weil Date: Tue, 16 Oct 2018 14:18:21 +0000 (-0500) Subject: common/AsyncReserver: Mutex -> ceph::mutex X-Git-Tag: v14.1.0~820^2~32 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=dc3571a21edc8bc47b1bc45a4fead28f2c11e7b6;p=ceph-ci.git common/AsyncReserver: Mutex -> ceph::mutex Signed-off-by: Sage Weil --- diff --git a/src/common/AsyncReserver.h b/src/common/AsyncReserver.h index c8c57409b45..c955584b7c0 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;