mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
70e42ebbf6
Since `Arc<T>` does not allow mutating `T` directly (i.e., without inner mutability), it is currently not possible to do some initialisation of `T` post construction but before being shared. `UniqueArc<T>` addresses this problem essentially being an `Arc<T>` that has a refcount of 1 and is therefore writable. Once initialisation is completed, it can be transitioned (without failure paths) into an `Arc<T>`. Suggested-by: Gary Guo <gary@garyguo.net> Signed-off-by: Wedson Almeida Filho <wedsonaf@gmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Gary Guo <gary@garyguo.net> Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com> Acked-by: Boqun Feng <boqun.feng@gmail.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
11 lines
269 B
Rust
11 lines
269 B
Rust
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
//! Synchronisation primitives.
|
|
//!
|
|
//! This module contains the kernel APIs related to synchronisation that have been ported or
|
|
//! wrapped for usage by Rust code in the kernel.
|
|
|
|
mod arc;
|
|
|
|
pub use arc::{Arc, ArcBorrow, UniqueArc};
|