use state machine management for exec.Pid()

Signed-off-by: Lifubang <lifubang@acmcoder.com>
This commit is contained in:
Lifubang
2018-11-23 17:46:32 +08:00
parent 32aa0cd79b
commit bbc2a995f9
3 changed files with 25 additions and 2 deletions

View File

@@ -69,8 +69,10 @@ func (e *execProcess) ID() string {
}
func (e *execProcess) Pid() int {
e.mu.Lock()
defer e.mu.Unlock()
return e.execState.Pid()
}
func (e *execProcess) pidv() int {
return e.pid
}