public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] rust: sync: atomic flag helpers
@ 2026-01-11  5:05 FUJITA Tomonori
  2026-01-11  5:05 ` [PATCH v3 1/2] rust: sync: atomic: Add i32-backed Flag for atomic booleans FUJITA Tomonori
  2026-01-11  5:05 ` [PATCH v3 2/2] rust: sync: atomic: Add AtomicFlag bool wrapper for easier use FUJITA Tomonori
  0 siblings, 2 replies; 9+ messages in thread
From: FUJITA Tomonori @ 2026-01-11  5:05 UTC (permalink / raw)
  To: boqun.feng, ojeda, peterz, will
  Cc: a.hindborg, aliceryhl, bjorn3_gh, dakr, gary, lossin,
	mark.rutland, tmgross, rust-for-linux

This series improves the Rust atomic-boolean support.

The first patch adds a Flag enum (Clear/Set) and implements AtomicType
for it, so Atomic<Flag> can be used when RMW operations (xchg/cmpxchg)
are needed and byte-sized RMWs may be inefficient.

The second patch adds AtomicFlag as a thin wrapper around Atomic<Flag>
to provide a simple bool-based load/store/xchg API.

v3:
- Add AtomicFlag struct provding a simple bool API
v2: https://lore.kernel.org/rust-for-linux/20260108125005.2945800-1-fujita.tomonori@gmail.com/
- Update the description
- Add bidirectional From conversions between Flag and bool
- Use intra-doc links
- Fix level header for Examples
- Fix a typo
- Add a newline after the `use`s block in examples
v1: https://lore.kernel.org/rust-for-linux/20260101102718.2073674-1-fujita.tomonori@gmail.com/

FUJITA Tomonori (2):
  rust: sync: atomic: Add i32-backed Flag for atomic booleans
  rust: sync: atomic: Add AtomicFlag bool wrapper for easier use

 rust/kernel/sync/atomic.rs | 102 +++++++++++++++++++++++++++++++++++++
 1 file changed, 102 insertions(+)


base-commit: 7bd94324bf04ca1161d94fc193adf782b0cfc0a9
-- 
2.43.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-01-13  1:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-11  5:05 [PATCH v3 0/2] rust: sync: atomic flag helpers FUJITA Tomonori
2026-01-11  5:05 ` [PATCH v3 1/2] rust: sync: atomic: Add i32-backed Flag for atomic booleans FUJITA Tomonori
2026-01-12  9:18   ` Alice Ryhl
2026-01-12 22:30     ` FUJITA Tomonori
2026-01-13  1:12       ` Gary Guo
2026-01-13  1:45         ` FUJITA Tomonori
2026-01-11  5:05 ` [PATCH v3 2/2] rust: sync: atomic: Add AtomicFlag bool wrapper for easier use FUJITA Tomonori
2026-01-12 12:51   ` Gary Guo
2026-01-12 22:40     ` FUJITA Tomonori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox