code: func AcquireLock(ctx context.Context, backend Backend, lockName string, ttl time.Duration) (err error) {
  	if lockName == "" {
  		return trace.BadParameter("missing parameter lock name")
  	}
  	key := []byte(filepath.Join(locksPrefix, lockName))
  	for {
  		// Get will clear TTL on a lock
  		backend.Get(ctx, key)
  
  		// CreateVal is atomic:
  		_, err = backend.Create(ctx, Item{Key: key, Value: []byte{1}, Expires: backend.Clock().Now().UTC().Add(ttl)})
  		if err == nil {
  			break // success
  		}
  		if trace.IsAlreadyExists(err) { // locked? wait and repeat:
  			backend.Clock().Sleep(250 * time.Millisecond)
  			continue
  		}
  		return trace.ConvertSystemError(err)
  	}
  	return nil
  }
docs: // AcquireLock grabs a lock that will be released automatically in TTL