Skip to content

Commit 4fd8f2c

Browse files
authored
Don't loop on CALLBACK_CODE_YIELD (#1289)
Upstream has now been fixed so it's possible to land this without a loop.
1 parent 8ded8f9 commit 4fd8f2c

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

crates/guest-rust/rt/src/async_support.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -351,18 +351,7 @@ pub unsafe fn callback(event0: u32, event1: u32, event2: u32) -> u32 {
351351
// our future so deallocate it. Otherwise put our future back in
352352
// context-local storage and forward the code.
353353
unsafe {
354-
let rc = match (*state).callback(event0, event1, event2) {
355-
// FIXME(wasip3-prototyping#140) this seems to break tests in
356-
// that repo. Handle this return code by re-running our callback
357-
// until it stops yielding.
358-
CALLBACK_CODE_YIELD => loop {
359-
match (*state).callback(EVENT_NONE, 0, 0) {
360-
CALLBACK_CODE_YIELD => {}
361-
other => break other,
362-
}
363-
},
364-
other => other,
365-
};
354+
let rc = (*state).callback(event0, event1, event2);
366355
if rc == CALLBACK_CODE_EXIT {
367356
drop(Box::from_raw(state));
368357
} else {

0 commit comments

Comments
 (0)