Move yunq to new thread spawn and remove old one.
This commit is contained in:
parent
79e1ea2791
commit
d777b8f4ab
7 changed files with 33 additions and 76 deletions
|
|
@ -369,17 +369,6 @@ fn generate_server(interface: &Interface) -> TokenStream {
|
|||
handler,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn run_server(&self) -> Result<Box<thread::Thread>, ZError> {
|
||||
let thread_entry = |server_ptr: *const c_void| {
|
||||
let server = unsafe { (server_ptr as *mut #server_name<T>).as_mut().expect("Failed to convert to server") };
|
||||
server.server_loop();
|
||||
};
|
||||
thread::Thread::spawn(
|
||||
thread_entry,
|
||||
self as *const Self as *const core::ffi::c_void,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: #server_trait> yunq::server::YunqServer for #server_name<T> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue