libtock_unittest: make Yield invoke queued upcalls.#330
Merged
bors[bot] merged 2 commits intotock:masterfrom Sep 12, 2021
Merged
libtock_unittest: make Yield invoke queued upcalls.#330bors[bot] merged 2 commits intotock:masterfrom
libtock_unittest: make Yield invoke queued upcalls.#330bors[bot] merged 2 commits intotock:masterfrom
Conversation
alistair23
approved these changes
Sep 6, 2021
hudson-ayers
approved these changes
Sep 8, 2021
Contributor
hudson-ayers
left a comment
There was a problem hiding this comment.
Looks good, but one comment
| // Pops the next upcall off the kernel data's upcall queue and invokes it, or | ||
| // does nothing if the upcall queue was entry. The return value indicates | ||
| // whether an upcall was run. Panics if no kernel data is present. | ||
| fn invoke_next_upcall() -> libtock_platform::YieldNoWaitReturn { |
Contributor
There was a problem hiding this comment.
It seems to me that this should just return a bool indicating whether an upcall was invoked. It seems strange to return YieldNoWaitReturn when this method is also called in response to yield-wait
Collaborator
Author
There was a problem hiding this comment.
I used YieldNoWaitReturn because it had the values I needed, but I agree the name is confusing. I changed to bool as you suggested.
I also replaced the if X { panic!(); } pattern with assert!(X, "...").
Returning `YieldNoWaitReturn` was confusing because `invoke_next_upcall` is used by both yield-wait and yield-no-wait.
hudson-ayers
approved these changes
Sep 10, 2021
Collaborator
Author
|
bors r+ |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With this PR, calling the Yield system calls will correctly invoke queued upcalls. This PR and #329 implement the fake Subscribe implementation in
libtock_unittest.