rust-bindings: `Sysroot` is `Send`
authorColin Walters <walters@verbum.org>
Sat, 4 Mar 2023 15:54:48 +0000 (10:54 -0500)
committerColin Walters <walters@verbum.org>
Sat, 4 Mar 2023 15:54:48 +0000 (10:54 -0500)
I want to spawn tokio worker threads referencing sysroot objects
in bootc.

Just like the repo, there's nothing thread-local about it.

rust-bindings/conf/ostree.toml
rust-bindings/src/auto/sysroot.rs
rust-bindings/src/auto/versions.txt
rust-bindings/sys/src/auto/versions.txt

index b0f0f60fb2bbc4a5c10ef50c051906efe223f3cd..6bcfe4f7ee494d55fcd1e754e726a6aa00c7530a 100644 (file)
@@ -217,6 +217,7 @@ status = "generate"
 [[object]]
 name = "OSTree.Sysroot"
 status = "generate"
+concurrency = "send"
     [[object.function]]
     name = "deploy_tree_with_options"
     [[object.function.parameter]]
index abb803876b810eaa259e4f7a4e23e853246d103a..32d5855e688443972f35f12bf7ccaa2bcff3526f 100644 (file)
@@ -543,8 +543,8 @@ impl Sysroot {
     #[cfg(any(feature = "v2017_10", feature = "dox"))]
     #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))]
     #[doc(alias = "journal-msg")]
-    pub fn connect_journal_msg<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId {
-        unsafe extern "C" fn journal_msg_trampoline<F: Fn(&Sysroot, &str) + 'static>(this: *mut ffi::OstreeSysroot, msg: *mut libc::c_char, f: glib::ffi::gpointer) {
+    pub fn connect_journal_msg<F: Fn(&Self, &str) + Send + 'static>(&self, f: F) -> SignalHandlerId {
+        unsafe extern "C" fn journal_msg_trampoline<F: Fn(&Sysroot, &str) + Send + 'static>(this: *mut ffi::OstreeSysroot, msg: *mut libc::c_char, f: glib::ffi::gpointer) {
             let f: &F = &*(f as *const F);
             f(&from_glib_borrow(this), &glib::GString::from_glib_borrow(msg))
         }
@@ -556,6 +556,8 @@ impl Sysroot {
     }
 }
 
+unsafe impl Send for Sysroot {}
+
 impl fmt::Display for Sysroot {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         f.write_str("Sysroot")
index 0553f42ab5778a5cdfe144350cb5cbcd21ea7441..154f5b0311750f9c63aec49c7404f6292ed02d24 100644 (file)
@@ -1,2 +1,2 @@
 Generated by gir (https://github.com/gtk-rs/gir @ 0eeebbdf9d4d)
-from gir-files (@ a43b14381142)
+from gir-files (@ be0dbf02d770)
index 0553f42ab5778a5cdfe144350cb5cbcd21ea7441..154f5b0311750f9c63aec49c7404f6292ed02d24 100644 (file)
@@ -1,2 +1,2 @@
 Generated by gir (https://github.com/gtk-rs/gir @ 0eeebbdf9d4d)
-from gir-files (@ a43b14381142)
+from gir-files (@ be0dbf02d770)