[PATCH] rust: maple_tree: implement Send and Sync for MapleTree
Eliot Courtney
ecourtney at nvidia.com
Tue Sep 8 02:53:58 PDT 2026
On Tue Sep 8, 2026 at 5:49 PM JST, Alice Ryhl wrote:
> On Tue, Sep 8, 2026 at 9:51 AM Eliot Courtney <ecourtney at nvidia.com> wrote:
>> +// SAFETY: `&MapleTree<T>` never hands out `&T`; all entry access is serialized
>> +// by `ma_lock` or `&mut Guard`, so `T: Send` suffices (`T: Sync` not required).
>> +unsafe impl<T: ForeignOwnable + Send> Sync for MapleTree<T> {}
>
> This is true now, but will change if load_rcu() from
> https://lore.kernel.org/all/20260116-rcu-box-v1-2-38ebfbcd53f0@google.com/
> got merged.
>
> It might be better to just pre-emptively require T: Sync now?
>
> Alice
Yeah that sounds reasonable to me. Thanks!
More information about the maple-tree
mailing list