Use strongly typed Pid and Option<Pid> types#10844
Merged
mqudsi merged 5 commits intofish-shell:masterfrom Nov 14, 2024
Merged
Conversation
Contributor
Author
|
Nope, it's just macOS CI being macOS CI. |
The previous approach of "treat this field as an `Option<NonZeroU32>` and remember to check `p.has_pid()` before accessing it" was a mix of C++ and rust conventions and led to some bugs or incorrect behaviors. * `jobs -p` would previously print both the (correct) external pid and the (incorrect) internal value of `0` if a backgrounded command contained a fish function (e.g. `function foo; end; cat | foo &; jobs`) * Updating/calculating job cpu time and usage was incorrectly including all of fish's cpu usage/time for each function/builtin member of the job pipeline. Closes fish-shell#10832
Statically assert that the interior value is both positive and non-zero.
This caught an incorrect description for process/job exit handlers for ANY_PID (now removed) which has been replaced with a message stating the handler is for any process exit event.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
There's a separate
AtomicPidtype because relying on not storing zero or negative values into aNonZeroI32was not working. This found a number of bugs or unhandled cases in the codebase.One thing I want to make sure of is that it is indeed an error to use
bg %0orjobs -q 0in the sense that they can never match a job?Closes #10832