1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

State: Keep track of the container start time

This commit is contained in:
Andrea Luzzardi 2013-01-22 15:03:27 -08:00
parent e035f3e92b
commit 64fc86fba7

View file

@ -2,12 +2,14 @@ package docker
import ( import (
"sync" "sync"
"time"
) )
type State struct { type State struct {
Running bool Running bool
Pid int Pid int
ExitCode int ExitCode int
StartedAt time.Time
stateChangeLock *sync.Mutex stateChangeLock *sync.Mutex
stateChangeCond *sync.Cond stateChangeCond *sync.Cond
@ -25,6 +27,7 @@ func (s *State) setRunning(pid int) {
s.Running = true s.Running = true
s.ExitCode = 0 s.ExitCode = 0
s.Pid = pid s.Pid = pid
s.StartedAt = time.Now()
s.broadcast() s.broadcast()
} }