getUnlockCallback will returns a function which unlock the logfile if the logfile is mmaped. otherwise, it unlock the logfile and return nil.
(lf *logFile)
| 1576 | // getUnlockCallback will returns a function which unlock the logfile if the logfile is mmaped. |
| 1577 | // otherwise, it unlock the logfile and return nil. |
| 1578 | func (vlog *valueLog) getUnlockCallback(lf *logFile) func() { |
| 1579 | if lf == nil { |
| 1580 | return nil |
| 1581 | } |
| 1582 | if vlog.opt.ValueLogLoadingMode == options.MemoryMap { |
| 1583 | return lf.lock.RUnlock |
| 1584 | } |
| 1585 | lf.lock.RUnlock() |
| 1586 | return nil |
| 1587 | } |
| 1588 | |
| 1589 | // readValueBytes return vlog entry slice and read locked log file. Caller should take care of |
| 1590 | // logFile unlocking. |
no outgoing calls