pub fn start_threaded(
        mut self,
        seccomp_filter: Arc<BpfProgram>,
        barrier: Arc<Barrier>,
    ) -> Result<VcpuHandle> {
        let event_sender = self.event_sender.take().expect("vCPU already started");
        let response_receiver = self.response_receiver.take().unwrap();
        let vcpu_thread = thread::Builder::new()
            .name(format!("fc_vcpu {}", self.kvm_vcpu.index))
            .spawn(move || {
                let filter = &*seccomp_filter;
                self.init_thread_local_data()
                    .expect("Cannot cleanly initialize vcpu TLS.");
                // Synchronization to make sure thread local data is initialized.
                barrier.wait();
                self.run(filter);
            })
            .map_err(Error::VcpuSpawn)?;

        Ok(VcpuHandle::new(
            event_sender,
            response_receiver,
            vcpu_thread,
        ))
    }
/// Moves the vcpu to its own thread and constructs a VcpuHandle.
/// The handle can be used to control the remote vcpu.
Moves the vcpu to its own thread and constructs a VcpuHandle.
The handle can be used to control the remote vcpu.
Moves the vcpu to its own thread and constructs a VcpuHandle . The handle can be used to control the remote vcpu .
pub fn start_threaded(
        mut self,
        seccomp_filter: Arc<BpfProgram>,
        barrier: Arc<Barrier>,
    ) -> Result<VcpuHandle> {
        let event_sender = self.event_sender.take().expect("vCPU already started");
        let response_receiver = self.response_receiver.take().unwrap();
        let vcpu_thread = thread::Builder::new()
            .name(format!("fc_vcpu {}", self.kvm_vcpu.index))
            .spawn(move || {
                let filter = &*seccomp_filter;
                self.init_thread_local_data()
                    .expect("Cannot cleanly initialize vcpu TLS.");
                // Synchronization to make sure thread local data is initialized.
                barrier.wait();
                self.run(filter);
            })
            .map_err(Error::VcpuSpawn)?;
        Ok(VcpuHandle::new(
            event_sender,
            response_receiver,
            vcpu_thread,
        ))
    }
pub fn start_threaded ( mut self , seccomp_filter : Arc < BpfProgram > , barrier : Arc < Barrier > , ) -> Result < VcpuHandle > { let event_sender = self . event_sender . take ( ) . expect ( " " ) ; let response_receiver = self . response_receiver . take ( ) . unwrap ( ) ; let vcpu_thread = thread :: Builder :: new ( ) . name ( format ! ( " " self kvm_vcpu index ) ) . spawn ( move | | { let filter = & * seccomp_filter ; self . init_thread_local_data ( ) . expect ( " " ) ; // Synchronization to make sure thread local data is initialized. barrier . wait ( ) ; self . run ( filter ) ; } ) . map_err ( Error :: VcpuSpawn ) ? ; Ok ( VcpuHandle :: new ( event_sender , response_receiver , vcpu_thread , ) ) }
Moves the vcpu to its own thread and constructs a VcpuHandle.
Moves the vcpu to its own thread and constructs a VcpuHandle .
mut self
seccomp_filter
Arc<BpfProgram>
barrier
Arc<Barrier>
mut self
seccomp_filter
Arc<BpfProgram>
barrier
Arc<Barrier>