diff options
author | Adam C. Emerson <aemerson@redhat.com> | 2018-08-23 17:17:26 +0200 |
---|---|---|
committer | Adam C. Emerson <aemerson@redhat.com> | 2018-08-27 15:09:01 +0200 |
commit | 851813d434da7a7fdcaba5e435253747cd8c4207 (patch) | |
tree | fcde4249a35c490dd0382b2ad54ea50c77393aaa /src/common/async | |
parent | include: Use ceph_assert for asserts (diff) | |
download | ceph-851813d434da7a7fdcaba5e435253747cd8c4207.tar.xz ceph-851813d434da7a7fdcaba5e435253747cd8c4207.zip |
common: Use ceph_assert for asserts
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Diffstat (limited to 'src/common/async')
-rw-r--r-- | src/common/async/detail/shared_mutex.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/common/async/detail/shared_mutex.h b/src/common/async/detail/shared_mutex.h index c44142d6610..100ec701909 100644 --- a/src/common/async/detail/shared_mutex.h +++ b/src/common/async/detail/shared_mutex.h @@ -22,6 +22,8 @@ #include <boost/intrusive_ptr.hpp> #include <boost/intrusive/list.hpp> +#include "include/assert.h" + #include "common/async/completion.h" namespace ceph::async::detail { @@ -110,9 +112,9 @@ class AsyncRequest : public LockRequest { inline SharedMutexImpl::~SharedMutexImpl() { - assert(state == Unlocked); - assert(shared_queue.empty()); - assert(exclusive_queue.empty()); + ceph_assert(state == Unlocked); + ceph_assert(shared_queue.empty()); + ceph_assert(exclusive_queue.empty()); } template <typename Mutex, typename CompletionToken> @@ -185,7 +187,7 @@ void SharedMutexImpl::unlock() RequestList granted; { std::lock_guard lock{mutex}; - assert(state == Exclusive); + ceph_assert(state == Exclusive); if (!exclusive_queue.empty()) { // grant next exclusive lock @@ -274,7 +276,7 @@ inline bool SharedMutexImpl::try_lock_shared() inline void SharedMutexImpl::unlock_shared() { std::lock_guard lock{mutex}; - assert(state != Unlocked && state <= MaxShared); + ceph_assert(state != Unlocked && state <= MaxShared); if (state == 1 && !exclusive_queue.empty()) { // grant next exclusive lock |