Skip to content

Commit

Permalink
proc: add minor comments (go-delve#2228)
Browse files Browse the repository at this point in the history
This patch adds some comments around RequestManualStop().
  • Loading branch information
andreimatei authored Nov 16, 2020
1 parent c94db60 commit 42f56e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/proc/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ type ThreadInfo interface {

// ProcessManipulation is an interface for changing the execution state of a process.
type ProcessManipulation interface {
// RequestManualStop attempts to stop all the process' threads.
RequestManualStop() error
// CheckAndClearManualStopRequest returns true the first time it's called
// after a call to RequestManualStop.
Expand Down
7 changes: 5 additions & 2 deletions pkg/proc/native/proc.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ type nativeProcess struct {

os *osProcessDetails
firstStart bool
stopMu sync.Mutex
resumeChan chan<- struct{}
ptraceChan chan func()
ptraceDoneChan chan interface{}
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

// Controlling terminal file descriptor for
Expand Down Expand Up @@ -176,7 +179,7 @@ func (dbp *nativeProcess) Breakpoints() *proc.BreakpointMap {
return &dbp.breakpoints
}

// RequestManualStop sets the `halt` flag and
// RequestManualStop sets the `manualStopRequested` flag and
// sends SIGSTOP to all threads.
func (dbp *nativeProcess) RequestManualStop() error {
if dbp.exited {
Expand Down

0 comments on commit 42f56e2

Please sign in to comment.