From 07e3bddf570adc96f4223ef70c13ea8cac20d3e9 Mon Sep 17 00:00:00 2001 From: Jason Francis Date: Sun, 13 Mar 2022 10:14:05 -0400 Subject: [PATCH] Use Send+Sync for more Boxed types --- cairo/src/font/font_options.rs | 3 +++ gdk-pixbuf/Gir.toml | 1 + gdk-pixbuf/src/auto/pixbuf_format.rs | 3 +++ gio/Gir.toml | 2 ++ gio/src/auto/unix_mount_entry.rs | 3 +++ gio/src/auto/unix_mount_point.rs | 3 +++ pango/Gir.toml | 9 ++++++++- pango/src/attribute.rs | 3 +++ pango/src/auto/attribute.rs | 3 +++ pango/src/auto/font_description.rs | 3 +++ pango/src/auto/glyph_string.rs | 3 +++ pango/src/auto/tab_array.rs | 3 +++ pango/src/language.rs | 3 +++ 13 files changed, 41 insertions(+), 1 deletion(-) diff --git a/cairo/src/font/font_options.rs b/cairo/src/font/font_options.rs index d133af34348c..7a52955f29bb 100644 --- a/cairo/src/font/font_options.rs +++ b/cairo/src/font/font_options.rs @@ -41,6 +41,9 @@ glib::wrapper! { #[doc(alias = "cairo_font_options_t")] pub struct FontOptions(ptr::NonNull); +unsafe impl Send for FontOptions {} +unsafe impl Sync for FontOptions {} + impl FontOptions { #[doc(alias = "cairo_font_options_create")] pub fn new() -> Result { diff --git a/gdk-pixbuf/Gir.toml b/gdk-pixbuf/Gir.toml index 017cf6d8c7a6..b6949b3fc9c1 100644 --- a/gdk-pixbuf/Gir.toml +++ b/gdk-pixbuf/Gir.toml @@ -149,6 +149,7 @@ manual_traits = ["PixbufAnimationExtManual"] [[object]] name = "GdkPixbuf.PixbufFormat" status = "generate" +concurrency = "send+sync" [[object.function]] pattern = "get_.+" [[object.function.parameter]] diff --git a/gdk-pixbuf/src/auto/pixbuf_format.rs b/gdk-pixbuf/src/auto/pixbuf_format.rs index a13103803992..6cccf33b24f0 100644 --- a/gdk-pixbuf/src/auto/pixbuf_format.rs +++ b/gdk-pixbuf/src/auto/pixbuf_format.rs @@ -112,3 +112,6 @@ impl PixbufFormat { } } } + +unsafe impl Send for PixbufFormat {} +unsafe impl Sync for PixbufFormat {} diff --git a/gio/Gir.toml b/gio/Gir.toml index 9091dbe386e7..d1eff7f0dca1 100644 --- a/gio/Gir.toml +++ b/gio/Gir.toml @@ -1263,6 +1263,7 @@ manual_traits = ["UnixInputStreamExtManual"] name = "Gio.UnixMountEntry" status = "generate" version = "2.54" +concurrency = "send+sync" cfg_condition = "unix" [[object.derive]] name = "Debug" @@ -1271,6 +1272,7 @@ cfg_condition = "unix" name = "Gio.UnixMountPoint" status = "generate" version = "2.54" +concurrency = "send+sync" cfg_condition = "unix" [[object.derive]] name = "Debug" diff --git a/gio/src/auto/unix_mount_entry.rs b/gio/src/auto/unix_mount_entry.rs index 9d257e4f4ae1..ccd3d4a5f8cf 100644 --- a/gio/src/auto/unix_mount_entry.rs +++ b/gio/src/auto/unix_mount_entry.rs @@ -12,3 +12,6 @@ glib::wrapper! { type_ => || ffi::g_unix_mount_entry_get_type(), } } + +unsafe impl Send for UnixMountEntry {} +unsafe impl Sync for UnixMountEntry {} diff --git a/gio/src/auto/unix_mount_point.rs b/gio/src/auto/unix_mount_point.rs index 99af4c4c62b6..330fbb24640f 100644 --- a/gio/src/auto/unix_mount_point.rs +++ b/gio/src/auto/unix_mount_point.rs @@ -172,3 +172,6 @@ impl Ord for UnixMountPoint { self.compare(other).cmp(&0) } } + +unsafe impl Send for UnixMountPoint {} +unsafe impl Sync for UnixMountPoint {} diff --git a/pango/Gir.toml b/pango/Gir.toml index be55e967445b..d137cd41ff5c 100644 --- a/pango/Gir.toml +++ b/pango/Gir.toml @@ -29,7 +29,6 @@ generate = [ "Pango.FontsetSimple", "Pango.Glyph", "Pango.GlyphItem", - "Pango.GlyphString", "Pango.GlyphUnit", "Pango.Gravity", "Pango.GravityHint", @@ -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 @@ -256,6 +256,7 @@ status = "generate" [[object]] name = "Pango.FontDescription" status = "generate" +concurrency = "send+sync" [[object.function]] name = "from_string" [object.function.return] @@ -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" @@ -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]] diff --git a/pango/src/attribute.rs b/pango/src/attribute.rs index f66d26d29ee5..1234cea3d322 100644 --- a/pango/src/attribute.rs +++ b/pango/src/attribute.rs @@ -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)] diff --git a/pango/src/auto/attribute.rs b/pango/src/auto/attribute.rs index 2b77ab41927a..e727ee0520bd 100644 --- a/pango/src/auto/attribute.rs +++ b/pango/src/auto/attribute.rs @@ -48,3 +48,6 @@ impl PartialEq for Attribute { } impl Eq for Attribute {} + +unsafe impl Send for Attribute {} +unsafe impl Sync for Attribute {} diff --git a/pango/src/auto/font_description.rs b/pango/src/auto/font_description.rs index b46f8045d52f..1daa909f8cba 100644 --- a/pango/src/auto/font_description.rs +++ b/pango/src/auto/font_description.rs @@ -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 {} diff --git a/pango/src/auto/glyph_string.rs b/pango/src/auto/glyph_string.rs index b903df3d0479..0e70b522f951 100644 --- a/pango/src/auto/glyph_string.rs +++ b/pango/src/auto/glyph_string.rs @@ -141,3 +141,6 @@ impl Default for GlyphString { Self::new() } } + +unsafe impl Send for GlyphString {} +unsafe impl Sync for GlyphString {} diff --git a/pango/src/auto/tab_array.rs b/pango/src/auto/tab_array.rs index 157b5852a2ff..471781c86f1a 100644 --- a/pango/src/auto/tab_array.rs +++ b/pango/src/auto/tab_array.rs @@ -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 {} diff --git a/pango/src/language.rs b/pango/src/language.rs index 985ef27bcdf9..452248c1f5ca 100644 --- a/pango/src/language.rs +++ b/pango/src/language.rs @@ -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;