Re: [PATCH v3 3/4] rust: devres: get rid of Devres' inner Arc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu Jun 26, 2025 at 12:01 PM CEST, Danilo Krummrich wrote:
> On Wed, Jun 25, 2025 at 09:13:24PM -0700, Boqun Feng wrote:
>> On Tue, Jun 24, 2025 at 11:54:01PM +0200, Danilo Krummrich wrote:
>> [...]
>> > +#[pin_data(PinnedDrop)]
>> > +pub struct Devres<T> {
>> 
>> It makes me realize: I think we need to make `T` being `Send`? Because
>> the devm callback can happen on a different thread other than
>> `Devres::new()` and the callback may drop `T` because of revoke(), so we
>> are essientially sending `T`. Alternatively we can make `Devres::new()`
>> and its friend require `T` being `Send`.
>> 
>> If it's true, we need a separate patch that "Fixes" this.
>
> Indeed, that needs a fix.

Oh and we have no `'static` bound on `T` either... We should require
that as well.

---
Cheers,
Benno





[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux