Source File
exec.go
Belonging Package
os
package os
import (
)
var ErrProcessDone = errors.New("os: process already finished")
type Process struct {
Pid int
handle uintptr // handle is accessed atomically on Windows
isdone uint32 // process has been successfully waited on, non zero if true
sigMu sync.RWMutex // avoid race between wait and signal
}
func ( int, uintptr) *Process {
:= &Process{Pid: , handle: }
runtime.SetFinalizer(, (*Process).Release)
return
}
func ( *Process) () {
atomic.StoreUint32(&.isdone, 1)
}
func ( *Process) () bool {
return atomic.LoadUint32(&.isdone) > 0
}
func ( int) (*Process, error) {
return findProcess()
}
func ( *Process) () (*ProcessState, error) {
return .wait()
}
func ( *ProcessState) () time.Duration {
return .userTime()
}
func ( *ProcessState) () time.Duration {
return .systemTime()
}
func ( *ProcessState) () bool {
return .exited()
}
func ( *ProcessState) () bool {
return .success()
}
func ( *ProcessState) () interface{} {
return .sys()
}
func ( *ProcessState) () interface{} {
return .sysUsage()
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |