Skip to content

Commit db614bb

Browse files
authored
Merge pull request #601 from jf2048/boxed-concurrency
Use Send+Sync for more Boxed types
2 parents bba02e3 + 07e3bdd commit db614bb

File tree

13 files changed

+41
-1
lines changed

13 files changed

+41
-1
lines changed

cairo/src/font/font_options.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ glib::wrapper! {
4141
#[doc(alias = "cairo_font_options_t")]
4242
pub struct FontOptions(ptr::NonNull<ffi::cairo_font_options_t>);
4343

44+
unsafe impl Send for FontOptions {}
45+
unsafe impl Sync for FontOptions {}
46+
4447
impl FontOptions {
4548
#[doc(alias = "cairo_font_options_create")]
4649
pub fn new() -> Result<FontOptions, Error> {

gdk-pixbuf/Gir.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ manual_traits = ["PixbufAnimationExtManual"]
149149
[[object]]
150150
name = "GdkPixbuf.PixbufFormat"
151151
status = "generate"
152+
concurrency = "send+sync"
152153
[[object.function]]
153154
pattern = "get_.+"
154155
[[object.function.parameter]]

gdk-pixbuf/src/auto/pixbuf_format.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,6 @@ impl PixbufFormat {
112112
}
113113
}
114114
}
115+
116+
unsafe impl Send for PixbufFormat {}
117+
unsafe impl Sync for PixbufFormat {}

gio/Gir.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,7 @@ manual_traits = ["UnixInputStreamExtManual"]
12801280
name = "Gio.UnixMountEntry"
12811281
status = "generate"
12821282
version = "2.54"
1283+
concurrency = "send+sync"
12831284
cfg_condition = "unix"
12841285
[[object.derive]]
12851286
name = "Debug"
@@ -1288,6 +1289,7 @@ cfg_condition = "unix"
12881289
name = "Gio.UnixMountPoint"
12891290
status = "generate"
12901291
version = "2.54"
1292+
concurrency = "send+sync"
12911293
cfg_condition = "unix"
12921294
[[object.derive]]
12931295
name = "Debug"

gio/src/auto/unix_mount_entry.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ glib::wrapper! {
1212
type_ => || ffi::g_unix_mount_entry_get_type(),
1313
}
1414
}
15+
16+
unsafe impl Send for UnixMountEntry {}
17+
unsafe impl Sync for UnixMountEntry {}

gio/src/auto/unix_mount_point.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,6 @@ impl Ord for UnixMountPoint {
172172
self.compare(other).cmp(&0)
173173
}
174174
}
175+
176+
unsafe impl Send for UnixMountPoint {}
177+
unsafe impl Sync for UnixMountPoint {}

pango/Gir.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ generate = [
2929
"Pango.FontsetSimple",
3030
"Pango.Glyph",
3131
"Pango.GlyphItem",
32-
"Pango.GlyphString",
3332
"Pango.GlyphUnit",
3433
"Pango.Gravity",
3534
"Pango.GravityHint",
@@ -123,6 +122,7 @@ status = "generate"
123122
[[object]]
124123
name = "Pango.Attribute"
125124
status = "generate"
125+
concurrency = "send+sync"
126126
[[object.function]]
127127
name = "init"
128128
# irrelevant with all the constructors and unusable like this
@@ -256,6 +256,7 @@ status = "generate"
256256
[[object]]
257257
name = "Pango.FontDescription"
258258
status = "generate"
259+
concurrency = "send+sync"
259260
[[object.function]]
260261
name = "from_string"
261262
[object.function.return]
@@ -290,6 +291,11 @@ status = "generate"
290291
# converted to proper constructors
291292
manual = true
292293

294+
[[object]]
295+
name = "Pango.GlyphString"
296+
status = "generate"
297+
concurrency = "send+sync"
298+
293299
[[object]]
294300
name = "Pango.Layout"
295301
status = "generate"
@@ -341,6 +347,7 @@ status = "generate"
341347
[[object]]
342348
name = "Pango.TabArray"
343349
status = "generate"
350+
concurrency = "send+sync"
344351
[[object.function]]
345352
pattern = "(to_string|get_decimal_point|get_positions_in_pixels|get_tab)"
346353
[[object.function.parameter]]

pango/src/attribute.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ macro_rules! define_attribute_struct {
9090
}
9191
}
9292

93+
unsafe impl Send for $rust_type {}
94+
unsafe impl Sync for $rust_type {}
95+
9396
#[cfg(not(any(feature = "v1_44", feature = "dox")))]
9497
glib::wrapper! {
9598
#[derive(Debug)]

pango/src/auto/attribute.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,6 @@ impl PartialEq for Attribute {
4848
}
4949

5050
impl Eq for Attribute {}
51+
52+
unsafe impl Send for Attribute {}
53+
unsafe impl Sync for Attribute {}

pango/src/auto/font_description.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,6 @@ impl hash::Hash for FontDescription {
313313
hash::Hash::hash(&self.hash(), state)
314314
}
315315
}
316+
317+
unsafe impl Send for FontDescription {}
318+
unsafe impl Sync for FontDescription {}

0 commit comments

Comments
 (0)