未验证 提交 42f56e28 编写于 作者: A Andrei Matei 提交者: GitHub

proc: add minor comments (#2228)

This patch adds some comments around RequestManualStop().
上级 c94db60d
......@@ -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.
......
......@@ -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
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册