Skip to content

Commit

Permalink
Auto-implement Send/Sync for types where this is possible
Browse files Browse the repository at this point in the history
And add static assertions to ensure this actually happens.
  • Loading branch information
sdroege authored and lu-zero committed Mar 27, 2024
1 parent 541376f commit aa69c1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ version = "0.10.2"
bitflags = "2"
dav1d-sys = { version = "0.8.2", path = "dav1d-sys" }
av-data = "0.4.2"
static_assertions = "1"

[features]

Expand Down
6 changes: 2 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,7 @@ impl std::ops::Deref for Plane {
}
}

unsafe impl Send for Plane {}
unsafe impl Sync for Plane {}
static_assertions::assert_impl_all!(Plane: Send, Sync);

/// Number of bits per component.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -729,8 +728,7 @@ impl Picture {
}
}

unsafe impl Send for Picture {}
unsafe impl Sync for Picture {}
static_assertions::assert_impl_all!(Picture: Send, Sync);

unsafe impl Send for InnerPicture {}
unsafe impl Sync for InnerPicture {}
Expand Down

0 comments on commit aa69c1b

Please sign in to comment.