use buffered channel so goroutine does not get blocked on done <- true when a timeout occurs.

Docker-DCO-1.1-Signed-off-by: Anandkumar Patel <anandkumarpatel@gmail.com> (github: anandkumarpatel)
Upstream-commit: 789a8f26161ca86a721fe6b7295e3eaf9051b3a2
Component: engine
This commit is contained in:
AnandkumarPatel
2014-05-20 17:20:26 -07:00
parent b9dbdb7d9e
commit 3921a34ddb

View File

@ -652,7 +652,7 @@ func (container *Container) Export() (archive.Archive, error) {
}
func (container *Container) WaitTimeout(timeout time.Duration) error {
done := make(chan bool)
done := make(chan bool, 1)
go func() {
container.Wait()
done <- true