From cf68949556a1868322c372f49c0ebe2f88d38379 Mon Sep 17 00:00:00 2001 From: Hui Tong Date: Wed, 3 Dec 2025 21:55:36 +0800 Subject: [PATCH] src/common: Add a destructor to shared_mutex_debug Signed-off-by: Hui Tong --- src/common/shared_mutex_debug.cc | 5 +++++ src/common/shared_mutex_debug.h | 1 + 2 files changed, 6 insertions(+) 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(); -- 2.47.3