[PATCH v2 3/5] rust: maple_tree: add MapleTree::lock() and load()
Danilo Krummrich
dakr at kernel.org
Tue Aug 19 04:36:27 PDT 2025
On Tue Aug 19, 2025 at 12:34 PM CEST, Alice Ryhl wrote:
> To load a value, one must be careful to hold the lock while accessing
> it. To enable this, we add a lock() method so that you can perform
> operations on the value before the spinlock is released.
>
> This adds a MapleGuard type without using the existing SpinLock type.
> This ensures that the MapleGuard type is not unnecessarily large, and
> that it is easy to swap out the type of lock in case the C maple tree is
> changed to use a different kind of lock.
>
> Co-developed-by: Andrew Ballance <andrewjballance at gmail.com>
> Signed-off-by: Andrew Ballance <andrewjballance at gmail.com>
> Reviewed-by: Andrew Ballance <andrewjballance at gmail.com>
> Signed-off-by: Alice Ryhl <aliceryhl at google.com>
Without the unwrap() calls in the examples,
Reviewed-by: Danilo Krummrich <dakr at kernel.org>
More information about the maple-tree
mailing list