We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 851b43c commit bf7fbe3Copy full SHA for bf7fbe3
hammer/hammer.go
@@ -301,7 +301,10 @@ func genLeaf(n uint64, minLeafSize int) []byte {
301
func newLeafGenerator(n uint64, minLeafSize int) func() []byte {
302
const dupChance = 0.1
303
nextLeaf := genLeaf(n, minLeafSize)
304
+ var safe sync.Mutex
305
return func() []byte {
306
+ safe.Lock()
307
+ defer safe.Unlock()
308
if rand.Float64() <= dupChance {
309
// This one will actually be unique, but the next iteration will
310
// duplicate it. In future, this duplication could be randomly
0 commit comments