Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
impr: add
T: Send
for AtomicLazyCell
Sync
impl
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.
- Loading branch information