thread.Halt: Remove duplication between OS implementations

Bring similar code up to top level, and keep OS dependant code in OS
dependant files. DRY up code a bit.
This commit is contained in:
Derek Parker
2015-08-20 10:06:33 -05:00
parent b9846c7684
commit 38e0051308
3 changed files with 18 additions and 18 deletions

View File

@ -12,15 +12,7 @@ type OSSpecificDetails struct {
registers sys.PtraceRegs
}
func (t *Thread) Halt() (err error) {
defer func() {
if err == nil {
t.running = false
}
}()
if t.Stopped() {
return
}
func (t *Thread) halt() (err error) {
err = sys.Tgkill(t.dbp.Pid, t.Id, sys.SIGSTOP)
if err != nil {
err = fmt.Errorf("halt err %s on thread %d", err, t.Id)