From b97c1237640ad0692a6dbbefb382ced5fcf3a129 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Wed, 11 Jun 2025 16:53:43 +0300 Subject: [PATCH] BAN: Make WeakPtr::lock const There is no reason why it would not be :) Also this prevented upstream from compiling --- BAN/include/BAN/WeakPtr.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BAN/include/BAN/WeakPtr.h b/BAN/include/BAN/WeakPtr.h index d68bfd05..b5d00416 100644 --- a/BAN/include/BAN/WeakPtr.h +++ b/BAN/include/BAN/WeakPtr.h @@ -20,7 +20,7 @@ namespace BAN class WeakLink : public RefCounted> { public: - RefPtr try_lock() + RefPtr try_lock() const { #if __is_kernel Kernel::SpinLockGuard _(m_weak_lock); @@ -44,7 +44,7 @@ namespace BAN private: T* m_ptr; #if __is_kernel - Kernel::SpinLock m_weak_lock; + mutable Kernel::SpinLock m_weak_lock; #endif friend class RefPtr>; }; @@ -99,7 +99,7 @@ namespace BAN return *this; } - RefPtr lock() + RefPtr lock() const { if (m_link) return m_link->try_lock();