Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unsafe impl {Send,Sync} for {Rav1dContext,TaskThreadData_delayed_fg} #1177

Open
kkysen opened this issue Jun 5, 2024 · 0 comments
Open
Assignees

Comments

@kkysen
Copy link
Collaborator

kkysen commented Jun 5, 2024

These were TODOs and are unjustified/unsound.

The types that need to be Send + Sync are:

  • Because of raw ptrs:
    • CArc<T>::stable_ref
    • Rav1dPicAllocator::cookie
    • Rav1dPictureData::allocator_data
    • Dav1dITUTT35::payload
  • Because of UnsafeCell:
    • DisjointMut<T>::inner

For these:

  • Rav1dPicAllocator::cookie
  • Rav1dPictureData::allocator_data
  • Dav1dITUTT35::payload

which are for C APIs, we should just delegate the safety requirements to # Safety docs. A wrapper Send + Sync ptr type might be useful.

For these:

  • CArc<T>::stable_ref
  • DisjointMut<T>::inner

Send + Sync is justified by the type and its API.

@kkysen kkysen self-assigned this Jun 16, 2024
kkysen added a commit that referenced this issue Jul 3, 2024
…e in `CBox::C::data` (#1279)

* Part of #1177.

This makes `CBox<T: Send + Sync>: Send + Sync`.

The `Unique<T>` here is just `core::ptr::Unique` copied essentially, but
since that is `#[doc(hidden)]`, I didn't want to use it directly.
kkysen added a commit that referenced this issue Jul 10, 2024
…`unsafe impl Send + Sync` on it (#1282)

* Part of #1177.

This makes `CArc<T: Send + Sync>: Send + Sync`.

Accidentally "merged" #1278 (it says merged but I didn't merge it) when
I flipped the order of the branches and PRs.
kkysen added a commit that referenced this issue Jul 11, 2024
…e impl Send + Sync` on it (#1277)

* Part of #1177.

This makes `Dav1dITUTT35: Send + Sync`.
@kkysen kkysen changed the title Remove unsafe impl {Send,Sync} for TaskThreadData_delayed_fg Remove unsafe impl {Send,Sync} for {Rav1dContext,TaskThreadData_delayed_fg} Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant