<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/rust/kernel/sync/set_once.rs, branch v7.0</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>rust: sync: set_once: Implement Send and Sync</title>
<updated>2026-01-09T11:01:40+00:00</updated>
<author>
<name>FUJITA Tomonori</name>
<email>fujita.tomonori@gmail.com</email>
</author>
<published>2025-12-16T00:09:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=8a581130b1cbc17c702298b8325e3df98c792760'/>
<id>8a581130b1cbc17c702298b8325e3df98c792760</id>
<content type='text'>
Implement Send and Sync for SetOnce&lt;T&gt; to allow it to be used across
thread boundaries.

Send: SetOnce&lt;T&gt; can be transferred across threads when T: Send, as
the contained value is also transferred and will be dropped on the
destination thread.

Sync: SetOnce&lt;T&gt; can be shared across threads when T: Sync, as
as_ref() provides shared references &amp;T and atomic operations ensure
proper synchronization. Since the inner T may be dropped on any
thread, we also require T: Send.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@gmail.com&gt;
Reviewed-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;
Signed-off-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Link: https://patch.msgid.link/20251216000901.221375-1-fujita.tomonori@gmail.com
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement Send and Sync for SetOnce&lt;T&gt; to allow it to be used across
thread boundaries.

Send: SetOnce&lt;T&gt; can be transferred across threads when T: Send, as
the contained value is also transferred and will be dropped on the
destination thread.

Sync: SetOnce&lt;T&gt; can be shared across threads when T: Sync, as
as_ref() provides shared references &amp;T and atomic operations ensure
proper synchronization. Since the inner T may be dropped on any
thread, we also require T: Send.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@gmail.com&gt;
Reviewed-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;
Signed-off-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Link: https://patch.msgid.link/20251216000901.221375-1-fujita.tomonori@gmail.com
</pre>
</div>
</content>
</entry>
<entry>
<title>rust: sync: add `SetOnce`</title>
<updated>2025-11-03T13:40:35+00:00</updated>
<author>
<name>Andreas Hindborg</name>
<email>a.hindborg@kernel.org</email>
</author>
<published>2025-09-24T12:39:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=821fe7bf16c57d690f4f92997f4e51abb93e0347'/>
<id>821fe7bf16c57d690f4f92997f4e51abb93e0347</id>
<content type='text'>
Introduce the `SetOnce` type, a container that can only be written once.
The container uses an internal atomic to synchronize writes to the internal
value.

Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Benno Lossin &lt;lossin@kernel.org&gt;
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Tested-by: Daniel Gomez &lt;da.gomez@samsung.com&gt;
Signed-off-by: Daniel Gomez &lt;da.gomez@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce the `SetOnce` type, a container that can only be written once.
The container uses an internal atomic to synchronize writes to the internal
value.

Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Benno Lossin &lt;lossin@kernel.org&gt;
Signed-off-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Tested-by: Daniel Gomez &lt;da.gomez@samsung.com&gt;
Signed-off-by: Daniel Gomez &lt;da.gomez@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
