Skip to content

Commit 6d94ae7

Browse files
committed
Mark as send+sync
1 parent 9d74f99 commit 6d94ae7

File tree

3 files changed

+50
-12
lines changed

3 files changed

+50
-12
lines changed

gio/Gir.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ status = "generate"
702702
[[object]]
703703
name = "Gio.DBusObjectManagerClient"
704704
status = "generate"
705+
concurrency = "send+sync"
705706
[[object.function]]
706707
name = "new"
707708
manual = true

gio/src/auto/dbus_object_manager_client.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ impl std::fmt::Display for DBusObjectManagerClient {
3434
}
3535
}
3636

37+
unsafe impl Send for DBusObjectManagerClient {}
38+
unsafe impl Sync for DBusObjectManagerClient {}
39+
3740
pub trait DBusObjectManagerClientExt: IsA<DBusObjectManagerClient> + 'static {
3841
#[doc(alias = "g_dbus_object_manager_client_get_connection")]
3942
#[doc(alias = "get_connection")]
@@ -98,14 +101,17 @@ pub trait DBusObjectManagerClientExt: IsA<DBusObjectManagerClient> + 'static {
98101

99102
#[doc(alias = "interface-proxy-signal")]
100103
fn connect_interface_proxy_signal<
101-
F: Fn(&Self, &DBusObjectProxy, &DBusProxy, &str, &str, &glib::Variant) + 'static,
104+
F: Fn(&Self, &DBusObjectProxy, &DBusProxy, &str, &str, &glib::Variant) + Send + Sync + 'static,
102105
>(
103106
&self,
104107
f: F,
105108
) -> SignalHandlerId {
106109
unsafe extern "C" fn interface_proxy_signal_trampoline<
107110
P: IsA<DBusObjectManagerClient>,
108-
F: Fn(&P, &DBusObjectProxy, &DBusProxy, &str, &str, &glib::Variant) + 'static,
111+
F: Fn(&P, &DBusObjectProxy, &DBusProxy, &str, &str, &glib::Variant)
112+
+ Send
113+
+ Sync
114+
+ 'static,
109115
>(
110116
this: *mut ffi::GDBusObjectManagerClient,
111117
object_proxy: *mut ffi::GDBusObjectProxy,
@@ -139,10 +145,13 @@ pub trait DBusObjectManagerClientExt: IsA<DBusObjectManagerClient> + 'static {
139145
}
140146

141147
#[doc(alias = "name-owner")]
142-
fn connect_name_owner_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
148+
fn connect_name_owner_notify<F: Fn(&Self) + Send + Sync + 'static>(
149+
&self,
150+
f: F,
151+
) -> SignalHandlerId {
143152
unsafe extern "C" fn notify_name_owner_trampoline<
144153
P: IsA<DBusObjectManagerClient>,
145-
F: Fn(&P) + 'static,
154+
F: Fn(&P) + Send + Sync + 'static,
146155
>(
147156
this: *mut ffi::GDBusObjectManagerClient,
148157
_param_spec: glib::ffi::gpointer,

gio/src/dbus_object_manager_client.rs

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ use glib::translate::{from_glib_borrow, from_glib_full, Borrowed, IntoGlib as _,
99
use std::future::Future;
1010
use std::pin::Pin;
1111

12-
type DBusProxyTypeFn =
13-
Box<dyn Fn(&DBusObjectManagerClient, &str, Option<&str>) -> glib::types::Type + 'static>;
12+
type DBusProxyTypeFn = Box<
13+
dyn Fn(&DBusObjectManagerClient, &str, Option<&str>) -> glib::types::Type
14+
+ Send
15+
+ Sync
16+
+ 'static,
17+
>;
1418

1519
impl DBusObjectManagerClient {
1620
#[doc(alias = "g_dbus_object_manager_client_new")]
1721
#[allow(clippy::new_ret_no_self)]
18-
pub fn new<P: FnOnce(Result<DBusObjectManagerClient, glib::Error>) + 'static>(
22+
pub fn new<P: FnOnce(Result<DBusObjectManagerClient, glib::Error>) + Send + Sync + 'static>(
1923
connection: &DBusConnection,
2024
flags: DBusObjectManagerClientFlags,
2125
name: &str,
@@ -61,7 +65,7 @@ impl DBusObjectManagerClient {
6165
}
6266

6367
unsafe extern "C" fn new_trampoline<
64-
P: FnOnce(Result<DBusObjectManagerClient, glib::Error>) + 'static,
68+
P: FnOnce(Result<DBusObjectManagerClient, glib::Error>) + Send + Sync + 'static,
6569
>(
6670
_source_object: *mut glib::gobject_ffi::GObject,
6771
res: *mut crate::ffi::GAsyncResult,
@@ -139,7 +143,9 @@ impl DBusObjectManagerClient {
139143

140144
#[doc(alias = "g_dbus_object_manager_client_new_for_bus")]
141145
#[allow(clippy::new_ret_no_self)]
142-
pub fn new_for_bus<P: FnOnce(Result<DBusObjectManagerClient, glib::Error>) + 'static>(
146+
pub fn new_for_bus<
147+
P: FnOnce(Result<DBusObjectManagerClient, glib::Error>) + Send + Sync + 'static,
148+
>(
143149
bus_type: BusType,
144150
flags: DBusObjectManagerClientFlags,
145151
name: &str,
@@ -185,7 +191,7 @@ impl DBusObjectManagerClient {
185191
}
186192

187193
unsafe extern "C" fn new_for_bus_trampoline<
188-
P: FnOnce(Result<DBusObjectManagerClient, glib::Error>) + 'static,
194+
P: FnOnce(Result<DBusObjectManagerClient, glib::Error>) + Send + Sync + 'static,
189195
>(
190196
_source_object: *mut glib::gobject_ffi::GObject,
191197
res: *mut crate::ffi::GAsyncResult,
@@ -269,7 +275,10 @@ impl DBusObjectManagerClient {
269275
object_path: &str,
270276
get_proxy_type_func: Option<
271277
Box<
272-
dyn Fn(&DBusObjectManagerClient, &str, Option<&str>) -> glib::types::Type + 'static,
278+
dyn Fn(&DBusObjectManagerClient, &str, Option<&str>) -> glib::types::Type
279+
+ Send
280+
+ Sync
281+
+ 'static,
273282
>,
274283
>,
275284
cancellable: Option<&impl IsA<Cancellable>>,
@@ -278,6 +287,8 @@ impl DBusObjectManagerClient {
278287
Option<
279288
Box<
280289
dyn Fn(&DBusObjectManagerClient, &str, Option<&str>) -> glib::types::Type
290+
+ Send
291+
+ Sync
281292
+ 'static,
282293
>,
283294
>,
@@ -294,6 +305,8 @@ impl DBusObjectManagerClient {
294305
let callback = &*(data as *mut Option<
295306
Box<
296307
dyn Fn(&DBusObjectManagerClient, &str, Option<&str>) -> glib::types::Type
308+
+ Send
309+
+ Sync
297310
+ 'static,
298311
>,
299312
>);
@@ -318,6 +331,8 @@ impl DBusObjectManagerClient {
318331
data as *mut Option<
319332
Box<
320333
dyn Fn(&DBusObjectManagerClient, &str, Option<&str>) -> glib::types::Type
334+
+ Send
335+
+ Sync
321336
+ 'static,
322337
>,
323338
>,
@@ -328,6 +343,8 @@ impl DBusObjectManagerClient {
328343
Option<
329344
Box<
330345
dyn Fn(&DBusObjectManagerClient, &str, Option<&str>) -> glib::types::Type
346+
+ Send
347+
+ Sync
331348
+ 'static,
332349
>,
333350
>,
@@ -361,7 +378,10 @@ impl DBusObjectManagerClient {
361378
object_path: &str,
362379
get_proxy_type_func: Option<
363380
Box<
364-
dyn Fn(&DBusObjectManagerClient, &str, Option<&str>) -> glib::types::Type + 'static,
381+
dyn Fn(&DBusObjectManagerClient, &str, Option<&str>) -> glib::types::Type
382+
+ Send
383+
+ Sync
384+
+ 'static,
365385
>,
366386
>,
367387
cancellable: Option<&impl IsA<Cancellable>>,
@@ -370,6 +390,8 @@ impl DBusObjectManagerClient {
370390
Option<
371391
Box<
372392
dyn Fn(&DBusObjectManagerClient, &str, Option<&str>) -> glib::types::Type
393+
+ Send
394+
+ Sync
373395
+ 'static,
374396
>,
375397
>,
@@ -386,6 +408,8 @@ impl DBusObjectManagerClient {
386408
let callback = &*(data as *mut Option<
387409
Box<
388410
dyn Fn(&DBusObjectManagerClient, &str, Option<&str>) -> glib::types::Type
411+
+ Send
412+
+ Sync
389413
+ 'static,
390414
>,
391415
>);
@@ -410,6 +434,8 @@ impl DBusObjectManagerClient {
410434
data as *mut Option<
411435
Box<
412436
dyn Fn(&DBusObjectManagerClient, &str, Option<&str>) -> glib::types::Type
437+
+ Send
438+
+ Sync
413439
+ 'static,
414440
>,
415441
>,
@@ -420,6 +446,8 @@ impl DBusObjectManagerClient {
420446
Option<
421447
Box<
422448
dyn Fn(&DBusObjectManagerClient, &str, Option<&str>) -> glib::types::Type
449+
+ Send
450+
+ Sync
423451
+ 'static,
424452
>,
425453
>,

0 commit comments

Comments
 (0)