Repository navigation
feat(nx-rt-core): run the applet message pump from Rust - #169
Merged
Merged
Conversation
The pump was the last part of the applet surface still running as C against globals a Rust bring-up leaves zeroed, so a program asked to close was never told and the cached state it reads never moved. - `main_loop` takes one pass — the poll and the acting-on already here — and reports whether the program lives on, which is what ends a `while (appletMainLoop())` - All three pump symbols are aliased together (`appletMainLoop`, `appletGetMessage`, `appletProcessMessage`) so no part of a pass runs against the zeroed globals: the C `appletProcessMessage` calls `diagAbortWithResult` when the refresh it does with them fails, so a pass reaching it would take the process down - Overriding `appletProcessMessage` replaces the applet hook dispatch with nothing: a program that registered an `appletHook` still gets a successful registration and a callback that never runs - The result code for an empty queue is named once and shared by the two entry points that can report it, rather than spelled out at each Signed-off-by: Lorenzo Delgado <lnsdev@proton.me>
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.
The pump was the last part of the applet surface still running as C against globals a Rust bring-up leaves zeroed, so a program asked to close was never told and the cached state it reads never moved.
main_looptakes one pass — the poll and the acting-on already here — and reports whether the program lives on, which is what ends awhile (appletMainLoop())appletMainLoop,appletGetMessage,appletProcessMessage) so no part of a pass runs against the zeroed globals: the CappletProcessMessagecallsdiagAbortWithResultwhen the refresh it does with them fails, so a pass reaching it would take the process downappletProcessMessagereplaces the applet hook dispatch with nothing: a program that registered anappletHookstill gets a successful registration and a callback that never runs