// Release pushs the connection back to the pool. The pool makes sure
// this connection must be usable before pushing it back to the acquirable
// list.
321079
func (p *Pool) Release(conn *Conn) {
	if conn == nil {
		return
	}
	p.mutex.Lock()
	defer p.mutex.Unlock()
	if p.closed {
		return
	}
	go p.pushBack(conn)
}
818377
func (cp *callPool) Release(c *Call) {
	if c.released == 0 && atomic.AddUint32(&c.released, 1) == 1 {
		cp.Lock()
		c.next = cp.free
		cp.free = c
		delete(cp.pending, c.req.Head.ID)
		cp.Unlock()
	}
}
368020
func (s *OIDSet) Release() (err error) {
	if s == nil || s.C_gss_OID_set == nil {
		return nil
	}

	var min C.OM_uint32
	maj := C.wrap_gss_release_oid_set(s.Fp_gss_release_oid_set, &min, &s.C_gss_OID_set)
	return s.stashLastStatus(maj, min)
}
1094356
func (r *ReleaseReadCloser) Release() io.ReadCloser {
	result := r.ReadCloser
	r.ReadCloser = nil
	return result
}
22350
func (p *ConnPool) releaseConn(conn *Conn) {
	refCount := atomic.AddInt32(&conn.refCount, -1)
	if refCount == 0 && atomic.LoadInt32(&conn.shouldClose) == 1 {
		conn.Close()
	}
}
600835
func (snap *dbCacheSnapshot) Release() {
	snap.dbSnapshot.Release()
	snap.pendingKeys = nil
	snap.pendingRemove = nil
}
393091
func (r *Route) Release() {
	if r.ref != nil {
		r.ref.decRef()
		r.ref = nil
	}
}
707579
func (b *Buffer) Release() error {
	if b == nil || b.C_gss_buffer_t == nil {
		return nil
	}

	defer func() {
		C.free(unsafe.Pointer(b.C_gss_buffer_t))
		b.C_gss_buffer_t = nil
		b.alloc = allocNone
	}()

	// free the value as needed
	switch {
	case b.C_gss_buffer_t.value == nil:
		// do nothing

	case b.alloc == allocMalloc:
		C.free(b.C_gss_buffer_t.value)

	case b.alloc == allocGSSAPI:
		var min C.OM_uint32
		maj := C.wrap_gss_release_buffer(b.Fp_gss_release_buffer, &min, b.C_gss_buffer_t)
		err := b.stashLastStatus(maj, min)
		if err != nil {
			return err
		}
	}

	return nil
}
899621
func (c *idCache) release(id ID) bool {
	if _, exists := c.leased[id]; !exists {
		return false
	}

	delete(c.leased, id)
	c.insert(id)

	return true
}
283490
func Release(id uint16) error {
	if !pool.Insert(idpool.ID(id)) {
		return fmt.Errorf("Unable to release endpoint ID %d", id)
	}

	return nil
}
181679
func (a *allocator) release(n int) {
	a.pool.SetBit(a.pool, n-a.low, free)
}
832394
func (lk *etcdLock) Release() error {
	keyName := "/contiv.io/lock/" + lk.name

	lk.mutex.Lock()
	defer lk.mutex.Unlock()

	// Mark this as released
	lk.isReleased = true

	// Send stop signal on stop channel
	lk.stopChan <- true

	// If the lock was acquired, release it
	if lk.isAcquired {
		// Delete the lock entry
		resp, err := lk.kapi.Delete(context.Background(), keyName, &client.DeleteOptions{PrevValue: lk.myID})
		if err != nil {
			log.Errorf("Error Deleting key. Err: %v", err)
		} else {
			log.Infof("Deleted key lock %s, Resp: %+v", keyName, resp)
		}

		lk.isAcquired = false
	}

	return nil
}
586276
func (db *Database) Release(sid string) {
	// clear all $sid-$key.
	db.Clear(sid)
	// and remove the $sid.
	txn := db.Service.NewTransaction(true)
	txn.Delete([]byte(sid))
	txn.Commit(nil)
}
551265
func (bp *BufferPool) Release(buf *bytes.Buffer) {
	buf.Reset()
	bp.pool.Put(buf)
}
668812
func (idx *NetworkIndex) Release() {
	for _, b := range idx.UsedPorts {
		bitmapPool.Put(b)
	}
}
699775
func (s *LedisStore) 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
	}

	if err = s.c.Set([]byte(s.sid), data); err != nil {
		return err
	}
	_, err = s.c.Expire([]byte(s.sid), s.expire)
	return err
}
115852
func (s *State) Release() {
	s.dbCond.L.Lock()
	defer s.dbCond.L.Unlock()
	s.dbUsers--
	if s.dbUsers == 0 {
		s.dbCond.Broadcast()
	}
}