MCPcopy
hub / github.com/dgraph-io/badger / waitOnGC

Method waitOnGC

value.go:1824–1832  ·  view source on GitHub ↗
(lc *y.Closer)

Source from the content-addressed store, hash-verified

1822}
1823
1824func (vlog *valueLog) waitOnGC(lc *y.Closer) {
1825 defer lc.Done()
1826
1827 <-lc.HasBeenClosed() // Wait for lc to be closed.
1828
1829 // Block any GC in progress to finish, and don't allow any more writes to runGC by filling up
1830 // the channel of size 1.
1831 vlog.garbageCh <- struct{}{}
1832}
1833
1834func (vlog *valueLog) runGC(discardRatio float64, head valuePointer) error {
1835 select {

Callers 1

OpenFunction · 0.80

Calls 2

HasBeenClosedMethod · 0.80
DoneMethod · 0.45

Tested by

no test coverage detected