feat(signal): support POSIX-compliant SIGCONT and SIGSTOP handling#6
Open
TomGoh wants to merge 8 commits intoStarry-OS:mainfrom
Open
feat(signal): support POSIX-compliant SIGCONT and SIGSTOP handling#6TomGoh wants to merge 8 commits intoStarry-OS:mainfrom
TomGoh wants to merge 8 commits intoStarry-OS:mainfrom
Conversation
Changes: - Return instead of to allow reporting signals without OS actions (e.g., ignored SIGCONT) - Add special handling in check_signals_slow() to return ignored SIGCONT with None action, enabling side effects without handler execution - Add signal management utilities: remove_signal(), has_signal(), flush_stop_signals() for process/thread signal managers - Implement PendingSignals::remove_signal() and has_signal() for direct queue manipulation
Fix the bug that when a process/thread set the disposition for SIGCONT to Ignore the delivery of SIGCONT to this process/thread when stopped is missing
…anism Changes: - Add SignalEventFlags struct and signal event to keep track of process stopping and continue events. - Add signal event setter, peek and consume functions for signal events
Changes: - Remove signal_events and last_stop_signal fields - Remove SignalEventFlags bitflags - Remove set_stop_signal, set_cont_signal methods - Remove peek/consume methods for stop/continue events - Clean up unused imports (AtomicU8, Ordering, bitflags) Rationale: Wait events moved to Process::ThreadGroup for POSIX compliance
This reverts commit d968f5e.
…t an unconsumed cont event and vice versa
b427177 to
5b503e3
Compare
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.
Changes:
check_signals_slowwould returnOption<(SignalInfo, Option<SignalOSAction>)>instead ofOption<(SignalInfo, SignalOSAction)>to allow reporting signals without OS actions (e.g., ignoredSIGCONT, which should be handled as normal when the target process is stopped).check_signals_slow()to return ignoredSIGCONTwith aNoneaction, enabling side effects without handler execution.remove_signal(),has_signal(),flush_stop_signals()for process/thread signal managers.PendingSignals::remove_signal()andhas_signal()for direct queue manipulation in support for upper process/thread layer operations.SignalEventFlagsbitflag struct to save a pending stop/continue event of a process.signal_eventsandlast_stop_signalfield inProcessSignalManagerto save stoppage due to signals for a process. When a process is stopped or continued due to signals, the corresponding event would be set in thesignal_eventflag and the stopping signal would be saved inlast_stop_signal.set_stop_signal,set_cont_signal,peek_pending_stop_event,peek_pending_cont_event,consume_stop_event, andconsume_cont_eventforProcessSignalManager. The stop/continue event would be set and the signal would be saved in theset_x_signalfunction.peek_pending_x_eventwould only examine whether there is a pending event and the saved signal, but does not make any modifications.consume_x_eventwould clear the saved signal and clear thesignal_eventflag.