File: put.go

package info (click to toggle)
golang-github-bmatsuo-lmdb-go 1.8.0%2Bgit20170215.a14b5a3-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 840 kB
  • sloc: ansic: 8,247; makefile: 19
file content (12 lines) | stat: -rw-r--r-- 581 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
// +build !race

package lmdbpool

// In general we want Txn objects to be returned to the sync.Pool. But because
// the default behavior of Pool.Put during race detection is to drop everything
// on the floor.  This isn't the end of world, but if the Txn finalizers don't
// don't run fast enough you can end up hitting the environment's limit on
// readers.  This is still not terrible unless you run your benchmarks with
// race detection enabled.  In such cases benchmarks issuing repeated reads
// will quickly blow the environments reader limit.
const returnTxnToPool = true