1
0
Fork 0

libasync: Sockets::run() returns !

This commit is contained in:
Astro 2020-04-16 20:42:21 +02:00
parent c3fc948714
commit 60e45f096d
2 changed files with 3 additions and 3 deletions

View File

@ -261,7 +261,7 @@ pub fn main_core0() {
Sockets::run(&mut iface, || { Sockets::run(&mut iface, || {
time += 1; time += 1;
Instant::from_millis(time) Instant::from_millis(time)
}); })
} }
static CORE1_REQ: Mutex<Option<sync_channel::Receiver<usize>>> = Mutex::new(None); static CORE1_REQ: Mutex<Option<sync_channel::Receiver<usize>>> = Mutex::new(None);

View File

@ -44,14 +44,14 @@ impl Sockets {
pub fn run<'b, 'c, 'e, D: for<'d> Device<'d>>( pub fn run<'b, 'c, 'e, D: for<'d> Device<'d>>(
iface: &mut EthernetInterface<'b, 'c, 'e, D>, iface: &mut EthernetInterface<'b, 'c, 'e, D>,
mut get_time: impl FnMut() -> Instant, mut get_time: impl FnMut() -> Instant,
) { ) -> ! {
task::block_on(async { task::block_on(async {
loop { loop {
let instant = get_time(); let instant = get_time();
Self::instance().poll(iface, instant); Self::instance().poll(iface, instant);
task::r#yield().await; task::r#yield().await;
} }
}); })
} }
pub(crate) fn instance() -> &'static Self { pub(crate) fn instance() -> &'static Self {