提交 be628132 编写于 作者: A Alessandro Arzilli 提交者: Derek Parker

proc: rename ManualStopRequested to CheckAndClearManualStopRequest (#1119)

上级 beb3e76f
......@@ -282,7 +282,7 @@ func (p *Process) RequestManualStop() error {
return nil
}
func (p *Process) ManualStopRequested() bool {
func (p *Process) CheckAndClearManualStopRequest() bool {
return false
}
......
......@@ -717,7 +717,7 @@ func (p *Process) RequestManualStop() error {
return p.conn.sendCtrlC()
}
func (p *Process) ManualStopRequested() bool {
func (p *Process) CheckAndClearManualStopRequest() bool {
p.conn.manualStopMutex.Lock()
msr := p.manualStopRequested
p.manualStopRequested = false
......
......@@ -87,9 +87,9 @@ type ProcessManipulation interface {
SwitchThread(int) error
SwitchGoroutine(int) error
RequestManualStop() error
// ManualStopRequested returns true the first time it's called after a call
// to RequestManualStop.
ManualStopRequested() bool
// CheckAndClearManualStopRequest returns true the first time it's called
// after a call to RequestManualStop.
CheckAndClearManualStopRequest() bool
Halt() error
Kill() error
Detach(bool) error
......
......@@ -183,7 +183,7 @@ func (dbp *Process) RequestManualStop() error {
return dbp.requestManualStop()
}
func (dbp *Process) ManualStopRequested() bool {
func (dbp *Process) CheckAndClearManualStopRequest() bool {
dbp.haltMu.Lock()
msr := dbp.manualStopRequested
dbp.manualStopRequested = false
......
......@@ -87,9 +87,9 @@ func Continue(dbp Process) error {
if dbp.Exited() {
return &ProcessExitedError{Pid: dbp.Pid()}
}
dbp.ManualStopRequested()
dbp.CheckAndClearManualStopRequest()
for {
if dbp.ManualStopRequested() {
if dbp.CheckAndClearManualStopRequest() {
return nil
}
trapthread, err := dbp.ContinueOnce()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册