Inject `val` into the `WaitingHostCall(id)` waiter and mark it Ready; false if no coro is parked on `id`. Lets the host resolve concurrent calls out of order. */
(&mut self, id: u64, val: Val)
| 91 | |
| 92 | /* Inject `val` into the `WaitingHostCall(id)` waiter and mark it Ready; false if no coro is parked on `id`. Lets the host resolve concurrent calls out of order. */ |
| 93 | pub fn inject_host_result_by_id(&mut self, id: u64, val: Val) -> bool { |
| 94 | match self.scheduler.iter().position(|h| matches!(h.state, CoroState::WaitingHostCall(w) if w == id)) { |
| 95 | Some(idx) => { self.deliver_host_result(idx, val); true } |
| 96 | None => false, |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | /* Shared tail: write `val` over the parked coro's saved-stack top and mark it Ready. */ |
| 101 | fn deliver_host_result(&mut self, idx: usize, val: Val) { |
no test coverage detected