Move yunq to new thread spawn and remove old one.

This commit is contained in:
Drew Galbraith 2025-01-26 00:05:55 -08:00
parent 79e1ea2791
commit d777b8f4ab
7 changed files with 33 additions and 76 deletions

View file

@ -2,6 +2,8 @@ use crate::buffer::ByteBuffer;
use alloc::vec::Vec;
use mammoth::cap::Capability;
use mammoth::syscall;
use mammoth::thread;
use mammoth::thread::JoinHandle;
use mammoth::zion::z_cap_t;
use mammoth::zion::ZError;
@ -50,3 +52,10 @@ pub trait YunqServer {
cap_buffer: &mut Vec<z_cap_t>,
) -> Result<usize, ZError>;
}
pub fn spawn_server_thread<T>(mut server: T) -> JoinHandle
where
T: YunqServer + Send + 'static,
{
thread::spawn(move || server.server_loop())
}