From: Hui Tong Date: Wed, 3 Dec 2025 13:55:36 +0000 (+0800) Subject: src/common: Add a destructor to shared_mutex_debug X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F66497%2Fhead;p=ceph.git src/common: Add a destructor to shared_mutex_debug Signed-off-by: Hui Tong --- diff --git a/src/common/shared_mutex_debug.cc b/src/common/shared_mutex_debug.cc index 258cf4039bbc..5e9e861d51f9 100644 --- a/src/common/shared_mutex_debug.cc +++ b/src/common/shared_mutex_debug.cc @@ -38,6 +38,11 @@ shared_mutex_debug::shared_mutex_debug(std::string group, ANNOTATE_BENIGN_RACE_SIZED(&nrlock, sizeof(nrlock), "shared_mutex_debug nrlock"); } +shared_mutex_debug::~shared_mutex_debug() +{ + pthread_rwlock_destroy(&rwlock); +} + // exclusive void shared_mutex_debug::lock() { diff --git a/src/common/shared_mutex_debug.h b/src/common/shared_mutex_debug.h index 1c1645b20cff..574e8e258e92 100644 --- a/src/common/shared_mutex_debug.h +++ b/src/common/shared_mutex_debug.h @@ -22,6 +22,7 @@ public: bool track_lock=true, bool enable_lock_dep=true, bool prioritize_write=false); + ~shared_mutex_debug(); // exclusive locking void lock(); bool try_lock();