]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/web_cache: use ceph::shared_mutex instead of std::shared_mutex 69893/head
authorKefu Chai <k.chai@proxmox.com>
Thu, 2 Jul 2026 00:50:10 +0000 (08:50 +0800)
committerKefu Chai <k.chai@proxmox.com>
Thu, 2 Jul 2026 01:46:12 +0000 (09:46 +0800)
commitb1345f257619a654cf0b955511f3883d8e95bd67
tree58c4b1e0b58c1cf368ef00ecc510591de86b2bfd
parent7240994bf53deabdfaf137a74cf886693682f4e9
common/web_cache: use ceph::shared_mutex instead of std::shared_mutex

WebCache declared its cache lock as a raw std::shared_mutex, bypassing the
project's ceph::shared_mutex alias that every other rwlock user goes through
(OSD::map_lock, TrackedOp::lock, ...). Align it with that convention: use
ceph::make_shared_mutex() to construct the member, and drop the explicit
<std::shared_mutex> template argument from each std::shared_lock/lock_guard
so they deduce whichever type ceph::shared_mutex resolves to.

This is idiom alignment only. The preceding commit fixes the Windows CI
timeout; this one does not touch it. ceph::shared_mutex only differs from
std::shared_mutex in debug builds, where it becomes ceph::shared_mutex_debug
for lockdep tracking. On the mingw-llvm release build that times out
unittest_web_cache, it still resolves straight to libc++'s std::shared_mutex.
The O(N^2) writer-wakeup behavior under heavy exclusive-lock contention is
unchanged.

Verified locally: unittest_web_cache builds and passes, exercising the debug
ceph::shared_mutex_debug path.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
src/common/web_cache.h