1
Fork 0

removed complexity (Send is an illusion)

This commit is contained in:
Andy Killorin 2024-12-19 12:42:43 -05:00
parent f44ab92299
commit 918f11598a
Signed by: ank
GPG key ID: 23F9463ECB67FE8C

View file

@ -11,12 +11,10 @@ async fn main() -> Result<()> {
let (tx,rx) = oneshot::channel();
let func: Symbol<unsafe extern fn(u64,u64, Receiver<u64>) -> Pin<Box<dyn Future<Output = u64> + Send>>> = unsafe {lib.get(b"add_wrapper")?};
let func = unsafe{func.into_raw()};
let fut = unsafe{func(12,54, rx)};
let out = tokio::spawn(async move {
fut.await
});
let out = tokio::spawn(fut);
tx.send(8).unwrap();