소스 검색

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)
AnandkumarPatel 11 년 전
부모
커밋
789a8f2616
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      daemon/container.go

+ 1 - 1
daemon/container.go

@@ -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