| Date | Sat, 31 Dec 2022 19:47:32 +0000 | From | Gary Guo <> | Subject | Re: [PATCH 6/7] rust: sync: introduce `UniqueArc` |
| |
On Wed, 28 Dec 2022 06:03:45 +0000 Wedson Almeida Filho <wedsonaf@gmail.com> wrote:
> 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: Gary Guo <gary@garyguo.net>
> --- > rust/kernel/sync.rs | 2 +- > rust/kernel/sync/arc.rs | 152 +++++++++++++++++++++++++++++++++++++++- > 2 files changed, 151 insertions(+), 3 deletions(-)
|