Skip to content

Commit

Permalink
Merge pull request #601 from jf2048/boxed-concurrency
Browse files Browse the repository at this point in the history
Use Send+Sync for more Boxed types
  • Loading branch information
sdroege authored Mar 13, 2022
2 parents bba02e3 + 07e3bdd commit db614bb
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cairo/src/font/font_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ glib::wrapper! {
#[doc(alias = "cairo_font_options_t")]
pub struct FontOptions(ptr::NonNull<ffi::cairo_font_options_t>);

unsafe impl Send for FontOptions {}
unsafe impl Sync for FontOptions {}

impl FontOptions {
#[doc(alias = "cairo_font_options_create")]
pub fn new() -> Result<FontOptions, Error> {
Expand Down
1 change: 1 addition & 0 deletions gdk-pixbuf/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ manual_traits = ["PixbufAnimationExtManual"]
[[object]]
name = "GdkPixbuf.PixbufFormat"
status = "generate"
concurrency = "send+sync"
[[object.function]]
pattern = "get_.+"
[[object.function.parameter]]
Expand Down
3 changes: 3 additions & 0 deletions gdk-pixbuf/src/auto/pixbuf_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,6 @@ impl PixbufFormat {
}
}
}

unsafe impl Send for PixbufFormat {}
unsafe impl Sync for PixbufFormat {}
2 changes: 2 additions & 0 deletions gio/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,7 @@ manual_traits = ["UnixInputStreamExtManual"]
name = "Gio.UnixMountEntry"
status = "generate"
version = "2.54"
concurrency = "send+sync"
cfg_condition = "unix"
[[object.derive]]
name = "Debug"
Expand All @@ -1288,6 +1289,7 @@ cfg_condition = "unix"
name = "Gio.UnixMountPoint"
status = "generate"
version = "2.54"
concurrency = "send+sync"
cfg_condition = "unix"
[[object.derive]]
name = "Debug"
Expand Down
3 changes: 3 additions & 0 deletions gio/src/auto/unix_mount_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ glib::wrapper! {
type_ => || ffi::g_unix_mount_entry_get_type(),
}
}

unsafe impl Send for UnixMountEntry {}
unsafe impl Sync for UnixMountEntry {}
3 changes: 3 additions & 0 deletions gio/src/auto/unix_mount_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,6 @@ impl Ord for UnixMountPoint {
self.compare(other).cmp(&0)
}
}

unsafe impl Send for UnixMountPoint {}
unsafe impl Sync for UnixMountPoint {}
9 changes: 8 additions & 1 deletion pango/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ generate = [
"Pango.FontsetSimple",
"Pango.Glyph",
"Pango.GlyphItem",
"Pango.GlyphString",
"Pango.GlyphUnit",
"Pango.Gravity",
"Pango.GravityHint",
Expand Down Expand Up @@ -123,6 +122,7 @@ status = "generate"
[[object]]
name = "Pango.Attribute"
status = "generate"
concurrency = "send+sync"
[[object.function]]
name = "init"
# irrelevant with all the constructors and unusable like this
Expand Down Expand Up @@ -256,6 +256,7 @@ status = "generate"
[[object]]
name = "Pango.FontDescription"
status = "generate"
concurrency = "send+sync"
[[object.function]]
name = "from_string"
[object.function.return]
Expand Down Expand Up @@ -290,6 +291,11 @@ status = "generate"
# converted to proper constructors
manual = true

[[object]]
name = "Pango.GlyphString"
status = "generate"
concurrency = "send+sync"

[[object]]
name = "Pango.Layout"
status = "generate"
Expand Down Expand Up @@ -341,6 +347,7 @@ status = "generate"
[[object]]
name = "Pango.TabArray"
status = "generate"
concurrency = "send+sync"
[[object.function]]
pattern = "(to_string|get_decimal_point|get_positions_in_pixels|get_tab)"
[[object.function.parameter]]
Expand Down
3 changes: 3 additions & 0 deletions pango/src/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ macro_rules! define_attribute_struct {
}
}

unsafe impl Send for $rust_type {}
unsafe impl Sync for $rust_type {}

#[cfg(not(any(feature = "v1_44", feature = "dox")))]
glib::wrapper! {
#[derive(Debug)]
Expand Down
3 changes: 3 additions & 0 deletions pango/src/auto/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ impl PartialEq for Attribute {
}

impl Eq for Attribute {}

unsafe impl Send for Attribute {}
unsafe impl Sync for Attribute {}
3 changes: 3 additions & 0 deletions pango/src/auto/font_description.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,6 @@ impl hash::Hash for FontDescription {
hash::Hash::hash(&self.hash(), state)
}
}

unsafe impl Send for FontDescription {}
unsafe impl Sync for FontDescription {}
3 changes: 3 additions & 0 deletions pango/src/auto/glyph_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,6 @@ impl Default for GlyphString {
Self::new()
}
}

unsafe impl Send for GlyphString {}
unsafe impl Sync for GlyphString {}
3 changes: 3 additions & 0 deletions pango/src/auto/tab_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,6 @@ impl fmt::Display for TabArray {
f.write_str(&self.to_str())
}
}

unsafe impl Send for TabArray {}
unsafe impl Sync for TabArray {}
3 changes: 3 additions & 0 deletions pango/src/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ use glib::GString;
#[doc(alias = "PangoLanguage")]
pub struct Language(*mut ffi::PangoLanguage);

unsafe impl Send for Language {}
unsafe impl Sync for Language {}

#[doc(hidden)]
impl<'a> ToGlibPtr<'a, *mut ffi::PangoLanguage> for &'a Language {
type Storage = &'a Language;
Expand Down

0 comments on commit db614bb

Please sign in to comment.