summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2023-03-04 10:54:48 -0500
committerColin Walters <walters@verbum.org>2023-03-04 10:54:48 -0500
commitb00f27d476e92874fbfb7c0e217d6413ddd0f699 (patch)
treefb43bc5d26738286321e496ee64ee36ae453b746
parentbe0dbf02d7706b924b5c40b4709405e2832cc859 (diff)
downloadostree-b00f27d476e92874fbfb7c0e217d6413ddd0f699.tar.gz
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.
-rw-r--r--rust-bindings/conf/ostree.toml1
-rw-r--r--rust-bindings/src/auto/sysroot.rs6
-rw-r--r--rust-bindings/src/auto/versions.txt2
-rw-r--r--rust-bindings/sys/src/auto/versions.txt2
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<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")
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)