[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230519094214.3433619-1-aliceryhl@google.com>
Date: Fri, 19 May 2023 09:42:14 +0000
From: Alice Ryhl <aliceryhl@...gle.com>
To: boqun.feng@...il.com
Cc: alex.gaynor@...il.com, aliceryhl@...gle.com,
benno.lossin@...ton.me, bjorn3_gh@...tonmail.com, gary@...yguo.net,
linux-kernel@...r.kernel.org, mark.rutland@....com,
mingo@...hat.com, ojeda@...nel.org, patches@...ts.linux.dev,
peterz@...radead.org, rust-for-linux@...r.kernel.org,
wedsonaf@...il.com, will@...nel.org
Subject: Re: [PATCH v1 1/2] rust: specify when `ARef` is thread safe
On 5/18/23 23:24, Boqun Feng wrote:
> On Wed, May 17, 2023 at 09:59:04AM +0000, Alice Ryhl wrote:
>> +// SAFETY: It is safe to send `ARef<T>` to another thread when the underlying `T` is `Sync` because
>> +// it effectively means sharing `&T` (which is safe because `T` is `Sync`); additionally, it needs
>> +// `T` to be `Send` because any thread that has an `ARef<T>` may ultimately access `T` directly, for
>
> Does the "ultimately access `T` directly" here imply mutably or
> exclusively? If so, it makes sense to me to call it out. I'm trying to
> make sure we can agree on some "common terminologies" ;)
It means "access using a mutable reference". I agree that "directly" is a bit
unclear - I copied it from the safety comment on Arc.
Alice
Powered by blists - more mailing lists