Skip to content

Commit

Permalink
Addresses bug defined in #7
Browse files Browse the repository at this point in the history
Fixed to allow multiple waker::wake calls to the future converted to Java
  • Loading branch information
dileping committed Feb 25, 2023
1 parent d9d79ad commit 61f4c96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rust/interop/src/future/into_java.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ impl<E: Send + Display, F: Future<Output = std::result::Result<GlobalRef, E>> +
let poll = fguard.as_mut().poll(&mut context);

let resolved = match poll {
Poll::Pending => {false}
Poll::Pending => {true}
Poll::Ready(r) => {jfut.resolve3(r).unwrap()}
};

if !resolved {
panic!("Wrong future state after the waker is awoken. A bug?")
panic!("It's a bug in wake. Why is the resolved future gets resolved again?")
};

Ok(())
Expand Down

0 comments on commit 61f4c96

Please sign in to comment.