File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 49
49
res
50
50
}
51
51
52
+ /// This waker is used in the Context of block_on. If a Future executing in
53
+ /// the block_on calls context.wake(), it sets this boolean state so that
54
+ /// block_on's Future is polled again immediately, rather than waiting for
55
+ /// an external (WASI pollable) event before polling again.
52
56
struct RootWaker {
53
57
wake : AtomicBool ,
54
58
}
Original file line number Diff line number Diff line change @@ -281,6 +281,8 @@ mod test {
281
281
let later = wasi:: clocks:: monotonic_clock:: subscribe_duration ( LONG_DURATION ) ;
282
282
let later = reactor. schedule ( later) ;
283
283
let mut polled_before = false ;
284
+ // This is basically futures_lite::future::yield_now, except with a boolean
285
+ // `polled_before` so we can definitively observe what happened
284
286
let wasi_independent_future = futures_lite:: future:: poll_fn ( |cx| {
285
287
if polled_before {
286
288
std:: task:: Poll :: Ready ( true )
You can’t perform that action at this time.
0 commit comments