code: func (scheduler *LatchesScheduler) Lock(startTS uint64, keys [][]byte) *Lock {
  	lock := scheduler.latches.genLock(startTS, keys)
  	lock.wg.Add(1)
  	if scheduler.latches.acquire(lock) == acquireLocked {
  		lock.wg.Wait()
  	}
  	if lock.isLocked() {
  		panic("should never run here")
  	}
  	return lock
  }
docs: // Lock acquire the lock for transaction with startTS and keys. The caller goroutine
  // would be blocked if the lock can't be obtained now. When this function returns,
  // the lock state would be either success or stale(call lock.IsStale)