You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per dbaupp's comments here, it might make sense to make the AtomicLazyCell<T>: Sync impl T: Sync + Send (possibly the Send impl too?).
@carllerche seeing as you initially wrote the code, and this is a (possibly?) breaking change, thoughts?
The text was updated successfully, but these errors were encountered:
indiv0
changed the title
Possible add a T: Send + Sync requirement to the Send and Sync impls
Possibley add a T: Send + Sync requirement to the Send and Sync impls
Feb 24, 2017
indiv0
changed the title
Possibley add a T: Send + Sync requirement to the Send and Sync impls
Possibly add a T: Send + Sync requirement to the Send and Sync impls
Feb 24, 2017
Add a `T: Send` to the existing `T: Sync` restriction on the `AtomicLazyCell`
`Sync` impl.
This is necessary because filling an `AtomicLazyCell` only requires a reference
to the cell (i.e. `&AtomicLazyCell`), which means that an empty
`&AtomicLazyCell<T>` can be passed to a child thread (provided that
`AtomicLazyCell<T>: Sync` is satisfied), and filled on the child thread.
The filled value would then be on the stack of, and destroyed by, the
parent thread.
Kudos to dbaupp on Reddit for this recommendation.
Closes#67.
BREAKING CHANGE: the `AtomicLazyCell` `Sync` impl now has a `<T: Sync + Send>`
constraint instead of a `<T: Sync>` constraint.
To migrate your code, remove any `AtomicLazyCell<T>` instances where
`<T: Sync + !Send>`, as this usecase is no longer supported.
Per dbaupp's comments here, it might make sense to make the
AtomicLazyCell<T>: Sync
implT: Sync + Send
(possibly theSend
impl too?).@carllerche seeing as you initially wrote the code, and this is a (possibly?) breaking change, thoughts?
The text was updated successfully, but these errors were encountered: