mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-05 21:53:20 +00:00
runtime-rs: remove unnecessary Send/Sync trait implement
Send and Sync are automatically derived traits, if a type is composed entirely of Send or Sync types, then it is Send or Sync. Almost all primitives are Send and Sync, so we don't need to implement them manually most of the time. Fixes: #6307 Signed-off-by: Tim Zhang <tim@hyper.sh>
This commit is contained in:
parent
c1602c848a
commit
95e3364493
@ -27,7 +27,6 @@ use std::{collections::HashSet, fs::create_dir_all, path::PathBuf};
|
||||
const DRAGONBALL_KERNEL: &str = "vmlinux";
|
||||
const DRAGONBALL_ROOT_FS: &str = "rootfs";
|
||||
|
||||
unsafe impl Send for DragonballInner {}
|
||||
unsafe impl Sync for DragonballInner {}
|
||||
pub struct DragonballInner {
|
||||
/// sandbox id
|
||||
|
@ -22,8 +22,6 @@ use tokio::sync::RwLock;
|
||||
|
||||
use crate::{device::Device, Hypervisor, VcpuThreadIds};
|
||||
|
||||
unsafe impl Send for Dragonball {}
|
||||
unsafe impl Sync for Dragonball {}
|
||||
pub struct Dragonball {
|
||||
inner: Arc<RwLock<DragonballInner>>,
|
||||
}
|
||||
|
@ -11,8 +11,6 @@ use common::{message::Message, RuntimeHandler, RuntimeInstance};
|
||||
use kata_types::config::TomlConfig;
|
||||
use tokio::sync::mpsc::Sender;
|
||||
|
||||
unsafe impl Send for LinuxContainer {}
|
||||
unsafe impl Sync for LinuxContainer {}
|
||||
pub struct LinuxContainer {}
|
||||
|
||||
#[async_trait]
|
||||
|
@ -145,8 +145,6 @@ impl RuntimeHandlerManagerInner {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for RuntimeHandlerManager {}
|
||||
unsafe impl Sync for RuntimeHandlerManager {}
|
||||
pub struct RuntimeHandlerManager {
|
||||
inner: Arc<RwLock<RuntimeHandlerManagerInner>>,
|
||||
}
|
||||
|
@ -25,8 +25,6 @@ use tokio::sync::RwLock;
|
||||
|
||||
use super::{logger_with_process, Container};
|
||||
|
||||
unsafe impl Send for VirtContainerManager {}
|
||||
unsafe impl Sync for VirtContainerManager {}
|
||||
pub struct VirtContainerManager {
|
||||
sid: String,
|
||||
pid: u32,
|
||||
|
@ -35,8 +35,6 @@ use resource::ResourceManager;
|
||||
use sandbox::VIRTCONTAINER;
|
||||
use tokio::sync::mpsc::Sender;
|
||||
|
||||
unsafe impl Send for VirtContainer {}
|
||||
unsafe impl Sync for VirtContainer {}
|
||||
pub struct VirtContainer {}
|
||||
|
||||
#[async_trait]
|
||||
|
@ -57,8 +57,6 @@ impl SandboxInner {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Send for VirtSandbox {}
|
||||
unsafe impl Sync for VirtSandbox {}
|
||||
#[derive(Clone)]
|
||||
pub struct VirtSandbox {
|
||||
sid: String,
|
||||
|
@ -10,8 +10,6 @@ use async_trait::async_trait;
|
||||
use common::{message::Message, RuntimeHandler, RuntimeInstance};
|
||||
use kata_types::config::TomlConfig;
|
||||
use tokio::sync::mpsc::Sender;
|
||||
unsafe impl Send for WasmContainer {}
|
||||
unsafe impl Sync for WasmContainer {}
|
||||
pub struct WasmContainer {}
|
||||
|
||||
#[async_trait]
|
||||
|
Loading…
Reference in New Issue
Block a user