summaryrefslogtreecommitdiff
path: root/vendor/github.com/klauspost/compress/zstd/blockdec.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-12-06 02:31:18 -0800
committerGitHub <noreply@github.com>2019-12-06 02:31:18 -0800
commit5c6eb1a94eb2688b28209997cbf18fa4aff97fe0 (patch)
tree9919e3d8fd5c7b5a8d6d625072bca2f672db3729 /vendor/github.com/klauspost/compress/zstd/blockdec.go
parent465e142bf28ed04e78c8b32c0ecef6fe72a38ecc (diff)
parent625a02a28616ee519f09f89da91f5d6a2e78f265 (diff)
downloadpodman-5c6eb1a94eb2688b28209997cbf18fa4aff97fe0.tar.gz
podman-5c6eb1a94eb2688b28209997cbf18fa4aff97fe0.tar.bz2
podman-5c6eb1a94eb2688b28209997cbf18fa4aff97fe0.zip
Merge pull request #4652 from containers/dependabot/go_modules/github.com/containers/storage-1.15.2
build(deps): bump github.com/containers/storage from 1.15.0 to 1.15.2
Diffstat (limited to 'vendor/github.com/klauspost/compress/zstd/blockdec.go')
-rw-r--r--vendor/github.com/klauspost/compress/zstd/blockdec.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/vendor/github.com/klauspost/compress/zstd/blockdec.go b/vendor/github.com/klauspost/compress/zstd/blockdec.go
index 47cc21d6d..ed670bcc7 100644
--- a/vendor/github.com/klauspost/compress/zstd/blockdec.go
+++ b/vendor/github.com/klauspost/compress/zstd/blockdec.go
@@ -89,6 +89,7 @@ type blockDec struct {
sequenceBuf []seq
tmp [4]byte
err error
+ decWG sync.WaitGroup
}
func (b *blockDec) String() string {
@@ -105,6 +106,7 @@ func newBlockDec(lowMem bool) *blockDec {
input: make(chan struct{}, 1),
history: make(chan *history, 1),
}
+ b.decWG.Add(1)
go b.startDecoder()
return &b
}
@@ -183,11 +185,13 @@ func (b *blockDec) Close() {
close(b.input)
close(b.history)
close(b.result)
+ b.decWG.Wait()
}
// decodeAsync will prepare decoding the block when it receives input.
// This will separate output and history.
func (b *blockDec) startDecoder() {
+ defer b.decWG.Done()
for range b.input {
//println("blockDec: Got block input")
switch b.Type {