lpproof treed: defer workWg.Done
This commit is contained in:
parent
91d3edecfd
commit
3b5165358a
@ -176,6 +176,8 @@ func BuildTreeD(data io.Reader, unpaddedData bool, outPath string, size abi.Padd
|
|||||||
// start processing
|
// start processing
|
||||||
workWg.Add(1)
|
workWg.Add(1)
|
||||||
go func(startOffset uint64) {
|
go func(startOffset uint64) {
|
||||||
|
defer workWg.Done()
|
||||||
|
|
||||||
if unpaddedData {
|
if unpaddedData {
|
||||||
paddedBuf := pool.Get(int(abi.UnpaddedPieceSize(len(workBuffer[0])).Padded()))
|
paddedBuf := pool.Get(int(abi.UnpaddedPieceSize(len(workBuffer[0])).Padded()))
|
||||||
fr32.PadSingle(workBuffer[0], paddedBuf)
|
fr32.PadSingle(workBuffer[0], paddedBuf)
|
||||||
@ -214,8 +216,6 @@ func BuildTreeD(data io.Reader, unpaddedData bool, outPath string, size abi.Padd
|
|||||||
bufLk.Lock()
|
bufLk.Lock()
|
||||||
workerBuffers = append(workerBuffers, workBuffer)
|
workerBuffers = append(workerBuffers, workBuffer)
|
||||||
bufLk.Unlock()
|
bufLk.Unlock()
|
||||||
|
|
||||||
workWg.Done()
|
|
||||||
}(processed)
|
}(processed)
|
||||||
|
|
||||||
processed += processedSize
|
processed += processedSize
|
||||||
|
Loading…
Reference in New Issue
Block a user