mirror of
https://github.com/go-delve/delve.git
synced 2025-10-30 18:27:37 +08:00
proc: add minor comments (#2228)
This patch adds some comments around RequestManualStop().
This commit is contained in:
@ -98,6 +98,7 @@ type ThreadInfo interface {
|
|||||||
|
|
||||||
// ProcessManipulation is an interface for changing the execution state of a process.
|
// ProcessManipulation is an interface for changing the execution state of a process.
|
||||||
type ProcessManipulation interface {
|
type ProcessManipulation interface {
|
||||||
|
// RequestManualStop attempts to stop all the process' threads.
|
||||||
RequestManualStop() error
|
RequestManualStop() error
|
||||||
// CheckAndClearManualStopRequest returns true the first time it's called
|
// CheckAndClearManualStopRequest returns true the first time it's called
|
||||||
// after a call to RequestManualStop.
|
// after a call to RequestManualStop.
|
||||||
|
|||||||
@ -27,11 +27,14 @@ type nativeProcess struct {
|
|||||||
|
|
||||||
os *osProcessDetails
|
os *osProcessDetails
|
||||||
firstStart bool
|
firstStart bool
|
||||||
stopMu sync.Mutex
|
|
||||||
resumeChan chan<- struct{}
|
resumeChan chan<- struct{}
|
||||||
ptraceChan chan func()
|
ptraceChan chan func()
|
||||||
ptraceDoneChan chan interface{}
|
ptraceDoneChan chan interface{}
|
||||||
childProcess bool // this process was launched, not attached to
|
childProcess bool // this process was launched, not attached to
|
||||||
|
stopMu sync.Mutex // protects manualStopRequested
|
||||||
|
// manualStopRequested is set if all the threads in the process were
|
||||||
|
// signalled to stop as a result of a Halt API call. Used to disambiguate
|
||||||
|
// why a thread is found to have stopped.
|
||||||
manualStopRequested bool
|
manualStopRequested bool
|
||||||
|
|
||||||
// Controlling terminal file descriptor for
|
// Controlling terminal file descriptor for
|
||||||
@ -176,7 +179,7 @@ func (dbp *nativeProcess) Breakpoints() *proc.BreakpointMap {
|
|||||||
return &dbp.breakpoints
|
return &dbp.breakpoints
|
||||||
}
|
}
|
||||||
|
|
||||||
// RequestManualStop sets the `halt` flag and
|
// RequestManualStop sets the `manualStopRequested` flag and
|
||||||
// sends SIGSTOP to all threads.
|
// sends SIGSTOP to all threads.
|
||||||
func (dbp *nativeProcess) RequestManualStop() error {
|
func (dbp *nativeProcess) RequestManualStop() error {
|
||||||
if dbp.exited {
|
if dbp.exited {
|
||||||
|
|||||||
Reference in New Issue
Block a user