From e33767cc2a3d5e69538be4b0b8484780f64c0938 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 20 Sep 2021 17:53:16 -0400 Subject: [PATCH] Make `SePolicy` have `Send` It's safe to send between threads, and I want to do so in ostree-rs-ext to send to a tokio worker thread. --- rust-bindings/rust/conf/ostree.toml | 1 + rust-bindings/rust/src/auto/se_policy.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/rust-bindings/rust/conf/ostree.toml b/rust-bindings/rust/conf/ostree.toml index 1d72f850..64abc10a 100644 --- a/rust-bindings/rust/conf/ostree.toml +++ b/rust-bindings/rust/conf/ostree.toml @@ -192,6 +192,7 @@ status = "generate" [[object]] name = "OSTree.SePolicy" status = "generate" +concurrency = "send" [[object.function]] # [IGNORE] has an unused raw pointer parameter name = "fscreatecon_cleanup" diff --git a/rust-bindings/rust/src/auto/se_policy.rs b/rust-bindings/rust/src/auto/se_policy.rs index 029e0785..d6e93cd4 100644 --- a/rust-bindings/rust/src/auto/se_policy.rs +++ b/rust-bindings/rust/src/auto/se_policy.rs @@ -106,6 +106,8 @@ impl SePolicy { } } +unsafe impl Send for SePolicy {} + impl fmt::Display for SePolicy { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("SePolicy")