From b00f27d476e92874fbfb7c0e217d6413ddd0f699 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sat, 4 Mar 2023 10:54:48 -0500 Subject: [PATCH] rust-bindings: `Sysroot` is `Send` 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 | 1 + rust-bindings/src/auto/sysroot.rs | 6 ++++-- rust-bindings/src/auto/versions.txt | 2 +- rust-bindings/sys/src/auto/versions.txt | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/rust-bindings/conf/ostree.toml b/rust-bindings/conf/ostree.toml index b0f0f60f..6bcfe4f7 100644 --- a/rust-bindings/conf/ostree.toml +++ b/rust-bindings/conf/ostree.toml @@ -217,6 +217,7 @@ status = "generate" [[object]] name = "OSTree.Sysroot" status = "generate" +concurrency = "send" [[object.function]] name = "deploy_tree_with_options" [[object.function.parameter]] diff --git a/rust-bindings/src/auto/sysroot.rs b/rust-bindings/src/auto/sysroot.rs index abb80387..32d5855e 100644 --- a/rust-bindings/src/auto/sysroot.rs +++ b/rust-bindings/src/auto/sysroot.rs @@ -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(&self, f: F) -> SignalHandlerId { - unsafe extern "C" fn journal_msg_trampoline(this: *mut ffi::OstreeSysroot, msg: *mut libc::c_char, f: glib::ffi::gpointer) { + pub fn connect_journal_msg(&self, f: F) -> SignalHandlerId { + unsafe extern "C" fn journal_msg_trampoline(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") diff --git a/rust-bindings/src/auto/versions.txt b/rust-bindings/src/auto/versions.txt index 0553f42a..154f5b03 100644 --- a/rust-bindings/src/auto/versions.txt +++ b/rust-bindings/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 0eeebbdf9d4d) -from gir-files (@ a43b14381142) +from gir-files (@ be0dbf02d770) diff --git a/rust-bindings/sys/src/auto/versions.txt b/rust-bindings/sys/src/auto/versions.txt index 0553f42a..154f5b03 100644 --- a/rust-bindings/sys/src/auto/versions.txt +++ b/rust-bindings/sys/src/auto/versions.txt @@ -1,2 +1,2 @@ Generated by gir (https://github.com/gtk-rs/gir @ 0eeebbdf9d4d) -from gir-files (@ a43b14381142) +from gir-files (@ be0dbf02d770)