diff options
Diffstat (limited to 'libgo/go/os/exec.go')
-rw-r--r-- | libgo/go/os/exec.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libgo/go/os/exec.go b/libgo/go/os/exec.go index 531b87ca556..6681acfd43b 100644 --- a/libgo/go/os/exec.go +++ b/libgo/go/os/exec.go @@ -6,6 +6,7 @@ package os import ( "runtime" + "sync/atomic" "syscall" ) @@ -13,7 +14,7 @@ import ( type Process struct { Pid int handle uintptr - done bool // process has been successfully waited on + isdone uint32 // process has been successfully waited on, non zero if true } func newProcess(pid int, handle uintptr) *Process { @@ -22,6 +23,14 @@ func newProcess(pid int, handle uintptr) *Process { return p } +func (p *Process) setDone() { + atomic.StoreUint32(&p.isdone, 1) +} + +func (p *Process) done() bool { + return atomic.LoadUint32(&p.isdone) > 0 +} + // ProcAttr holds the attributes that will be applied to a new process // started by StartProcess. type ProcAttr struct { |