State: Keep track of the container start time

Upstream-commit: 64fc86fba760dd5cb34cd6d9f3ddf13dc3dc4280
Component: engine
This commit is contained in:
Andrea Luzzardi
2013-01-22 15:03:27 -08:00
parent d26b69de49
commit 37ddcb4a4a
+3
View File
@@ -2,12 +2,14 @@ package docker
import (
"sync"
"time"
)
type State struct {
Running bool
Pid int
ExitCode int
StartedAt time.Time
stateChangeLock *sync.Mutex
stateChangeCond *sync.Cond
@@ -25,6 +27,7 @@ func (s *State) setRunning(pid int) {
s.Running = true
s.ExitCode = 0
s.Pid = pid
s.StartedAt = time.Now()
s.broadcast()
}