don't heap allocate the cond, just set L

This commit is contained in:
vyzo 2021-07-13 12:10:32 +03:00
parent 524564e2cf
commit 5cf6fdf81d

View File

@ -97,7 +97,7 @@ type Blockstore struct {
viewers sync.WaitGroup
moveMx sync.RWMutex
moveCond *sync.Cond
moveCond sync.Cond
moveState int
rlock int
@ -136,7 +136,7 @@ func Open(opts Options) (*Blockstore, error) {
bs.prefixLen = len(bs.prefix)
}
bs.moveCond = sync.NewCond(&bs.moveMx)
bs.moveCond.L = &bs.moveMx
return bs, nil
}