Re: [PATCH v5 17/18] rust: sync: Add SpinLockIrq
From: Boqun Feng
Date: Mon Aug 10 2026 - 09:48:00 EST
On Mon, Aug 10, 2026 at 11:02:13AM +0200, Peter Zijlstra wrote:
> On Fri, Aug 07, 2026 at 12:02:14AM -0700, Boqun Feng wrote:
>
> > -pub use lock::spinlock::{new_spinlock, SpinLock, SpinLockGuard};
> > +pub use lock::spinlock::{
> > + new_spinlock,
> > + new_spinlock_irq,
> > + SpinLock,
> > + SpinLockGuard,
> > + SpinLockIrq,
> > + SpinLockIrqGuard, //
> > +};
>
> What's this new_spinlock* stuff about? It has sensible naming; unlike
> that CameCase nonsense the rest has.
They're the counter part of *spin_lock_init() in C side, similar as C,
they need to macros to expand at callsite for lock class key generation.
Types and Traits use CameCase, and macros and functions use snake_case.
Regards,
Boqun