type Latches struct {
sync.RWMutex// contains filtered or unexported fields
}
Latches which are used for concurrency control.
Each latch is indexed by a slot's ID, hence the term latch and slot are used in interchangeable,
but conceptually a latch is a queue, and a slot is an index to the queue
func (latches *Latches) Acquire(lock *Lock) (success, stale bool)
Acquire tries to acquire the lock for a transaction.
It returns with stale = true when the transaction is stale(
when the lock.startTS is smaller than any key's last commitTS).
Release releases all latches owned by the `lock` and returns the wakeup list.
Preconditions: the caller must ensure the transaction is at the front of the latches.