[process] Fix #773 remove data race in NewProcess

Reproduction case https://github.com/shirou/gopsutil/issues/773#issuecomment-554723678
pull/790/head
Lomanic 5 years ago
parent c9a2a69ca7
commit e34a731c69

@ -163,7 +163,7 @@ func NewProcess(pid int32) (*Process, error) {
if !exists {
return p, ErrorProcessNotRunning
}
go p.CreateTime()
p.CreateTime()
return p, nil
}

Loading…
Cancel
Save