// ReleaseLock implements the MDServer interface for MDServerMemory.
777441
func (md *MDServerMemory) ReleaseLock(ctx context.Context,
	tlfID tlf.ID, lockID keybase1.LockID) error {
	md.lock.Lock()
	defer md.lock.Unlock()
	md.releaseLockLocked(ctx, tlfID, lockID)
	return nil
}
1315488
func (n *nsLockMap) Lock(volume, path, opsID string, timeout time.Duration) (locked bool) {
	readLock := false // This is a write lock.

	lockSource := getSource() // Useful for debugging
	return n.lock(volume, path, lockSource, opsID, readLock, timeout)
}
230232
func (s *RedisStore) Release() error {
	// Skip encoding if the data is empty
	if len(s.data) == 0 {
		return nil
	}

	data, err := session.EncodeGob(s.data)
	if err != nil {
		return err
	}

	return s.c.SetEx(s.prefix+s.sid, s.duration, string(data)).Err()
}
206676
func mustReleaseLock(c context.Context, lock fslock.Handle, fn func() error) error {
	defer func() {
		if err := lock.Unlock(); err != nil {
			errors.Log(c, errors.Annotate(err, "failed to release lock").Err())
			// TODO(maruel): There's a bug somewhere here that cases failures on
			// Swarming tasks. Since they are running in a contained environment, it
			// is not as much as a big deal. Experimenting if a Swarming task can
			// survive the fact that the lock is not released.
			// https://crbug.com/869227
			//panic(err)
		}
	}()
	return fn()
}
924403
func (c *Client) ReleaseRollback(appIdentity, release, message string) (*Release, error) {
	params := struct {
		Release string `json:"release"`
	}{
		Release: release,
	}
	rh := RequestHeaders{CommitMessage: message}
	var releaseRes Release
	return &releaseRes, c.PostWithHeaders(&releaseRes, "/apps/"+appIdentity+"/releases", params, rh.Headers())
}
98645
func (i *Idm) Release(id uint64) {
	i.handle.Unset(id - i.start)
}
1325868
func (s *FileStore) Release() error {
	s.p.lock.Lock()
	defer s.p.lock.Unlock()

	// Skip encoding if the data is empty
	if len(s.data) == 0 {
		return nil
	}

	data, err := EncodeGob(s.data)
	if err != nil {
		return err
	}

	return ioutil.WriteFile(s.p.filepath(s.sid), data, 0600)
}
782602
func (t *ContainerVolumeTracker) Release() []error {
	if t == nil {
		return nil
	}
	for path := range t.paths {
		t.ReleasePath(path)
	}
	return t.errs
}
1183770
func (r *Allocator) Release(id uint32) error {
	ok, offset := r.netIDRange.Contains(id)
	if !ok {
		return nil
	}
	return r.alloc.Release(int(offset))
}
115852
func (s *State) Release() {
	s.dbCond.L.Lock()
	defer s.dbCond.L.Unlock()
	s.dbUsers--
	if s.dbUsers == 0 {
		s.dbCond.Broadcast()
	}
}
122766
func (r *Allocator) Release(block uid.Block) error {
	ok, offset := r.contains(block)
	if !ok {
		// TODO: log a warning
		return nil
	}

	return r.alloc.Release(int(offset))
}
597366
func (c *channelPool) Release() {
	c.mu.Lock()
	conns := c.conns
	c.conns = nil
	c.factory = nil
	c.ping = nil
	closeFun := c.close
	c.close = nil
	c.mu.Unlock()

	if conns == nil {
		return
	}

	close(conns)
	for wrapConn := range conns {
		closeFun(wrapConn.conn)
	}
}
297804
func (l *FileLock) SharedLock() error {
	return syscall.Flock(l.fd, syscall.LOCK_SH)
}
1163826
func (c *Pool) Release(ctx Context) {
	ctx.EndRequest()
	c.pool.Put(ctx)
}
1008448
func (p *ConnectionPool) Release(c *Connection, err error) {
	if c == nil {
		return
	}

	if err != nil {
		p.retryNewConnection(nil)
		return
	}
	p.pool <- c
}
165280
func (w *Wallet) release() error {
	if w.session != nil {
		return w.session.release()
	}
	return nil
}
632226
func (s *Dynamic) Release() {
	s.mu.Lock()
	defer s.mu.Unlock()

	if s.cur < 1 {
		panic("semaphore: bad release")
	}

	next := s.waiters.Front()

	// If there are no waiters, just decrement and we're done
	if next == nil {
		s.cur--
		return
	}

	// Need to yield our slot to the next waiter.
	// Remove them from the list
	s.waiters.Remove(next)
	// And trigger it's chan before we release the lock
	close(next.Value.(chan struct{}))
	// Note we _don't_ decrement inflight since the slot was yielded directly.
}