MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / pollster_block_on

Function pollster_block_on

native/windows/src/lib.rs:1764–1779  ·  view source on GitHub ↗
(future: F)

Source from the content-addressed store, hash-verified

1762}
1763
1764fn pollster_block_on<F: std::future::Future>(future: F) -> F::Output {
1765 use std::task::{Context, Poll, Wake, Waker};
1766 use std::pin::Pin;
1767 use std::sync::Arc;
1768 struct NoopWaker;
1769 impl Wake for NoopWaker { fn wake(self: Arc<Self>) {} }
1770 let waker = Waker::from(Arc::new(NoopWaker));
1771 let mut cx = Context::from_waker(&waker);
1772 let mut future = unsafe { Pin::new_unchecked(Box::new(future)) };
1773 loop {
1774 match future.as_mut().poll(&mut cx) {
1775 Poll::Ready(result) => return result,
1776 Poll::Pending => std::thread::yield_now(),
1777 }
1778 }
1779}
1780
1781// 3D engine stubs — not yet implemented on Windows
1782#[no_mangle] pub extern "C" fn bloom_register_frame_callback(_priority: f64, _callback: extern "C" fn(f64)) -> f64 { 0.0 }

Callers 1

bloom_init_windowFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected