Re: [PATCH v5] rust: add global lock support

From: Alice Ryhl
Date: Wed Oct 23 2024 - 09:39:58 EST


On Tue, Oct 22, 2024 at 7:24 PM Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
>
> On Tue, Oct 22, 2024 at 6:44 PM Boqun Feng <boqun.feng@xxxxxxxxx> wrote:
> >
> > On Tue, Oct 22, 2024 at 02:46:19PM +0200, Alice Ryhl wrote:
> > > no contents, but implements an unsafe trait saying that there's only
> > > one static using it.
> > >
> > > This way we also do not need the helper module, as we no longer need
> > > to generate a struct with private fields.
> > >
> >
> > Sounds good to me. Do you plan to let the user name the token type? It's
> > fine to me, or do you want to name the token based on the static lock
> > name?
>
> The name of the lock has the wrong case, so we can't really reuse it.

It turns out that we can have a type and a static of the same name, so
I went ahead and reused the static's name. I think it turned out
pretty nicely!

PTAL: https://lore.kernel.org/all/20241023-static-mutex-v6-1-d7efdadcc84f@xxxxxxxxxx/

Alice