// Len is the same as bytes.Buffer.Len.
170112
func (b *Buffer) Len() int {
	version := b.preOp()
	n := b.buf.Len()
	b.postOp(version)
	return n
}
1349573
func (q *Type) Len() int {
	q.cond.L.Lock()
	defer q.cond.L.Unlock()
	return len(q.queue)
}
595076
func (b *LRUCache) Len() int {
	// yes. this stupid thing requires locking
	b.lock.Lock()
	defer b.lock.Unlock()

	return b.lruList.Len()
}
515155
func (q *Queue) Len() int64 {
	q.lock.Lock()
	defer q.lock.Unlock()

	return int64(len(q.items))
}
616072
func (h *singleConnectionHeap) Len() int {
	cnt := 0
	h.mutex.Lock()

	if !h.full {
		if h.head >= h.tail {
			cnt = int(h.head) - int(h.tail)
		} else {
			cnt = int(h.size) - (int(h.tail) - int(h.head))
		}
	} else {
		cnt = int(h.size)
	}
	h.mutex.Unlock()
	return cnt
}
191858
func (b *Buffer) Len() int {
	return len(b.data) / b.f.Width()
}
1063939
func (db *Database) Len() int {
	db.lock.RLock()
	defer db.lock.RUnlock()

	return len(db.db)
}
1067714
func (c *Cache) Len() int {
	c.Lock()
	defer c.Unlock()
	return c.l.Len()
}
354052
func (pool *Pool) Len(queue string) (int, error) {
	sess := pool.redis.Get()
	defer sess.Close()

	length, err := redis.Int(sess.Do("QLEN", queue))
	if err != nil {
		return 0, err
	}

	return length, nil
}
909072
func (pp *Publish) Len() int {
	ml := pp.len()
	return headerLen(ml) + ml
}
34192
func (p *ConnPool) Len() int {
	p.connsMu.Lock()
	n := len(p.conns)
	p.connsMu.Unlock()
	return n
}
1200261
func (c *Cache) Len() int {
	c.mtx.RLock()
	defer c.mtx.RUnlock()

	return c.ll.Len()
}
219058
func (set *Set) Len() int64 {
	set.lock.RLock()

	size := int64(len(set.items))

	set.lock.RUnlock()

	return size
}
209027
func (m *ClientManager) Len() int {
	if m.cache == nil {
		return 0
	}
	m.mu.Lock()
	defer m.mu.Unlock()
	return m.ll.Len()
}
812528
func (b *Buffer) Size() int {
	size := len(b.Buf)
	for _, buf := range b.bufs {
		size += len(buf)
	}
	return size
}
46891
func (b *PCMBuffer) Len() int {
	if b == nil {
		return 0
	}

	switch b.DataType {
	case DataTypeI8:
		return len(b.I8)
	case DataTypeI16:
		return len(b.I16)
	case DataTypeI32:
		return len(b.I32)
	case DataTypeF32:
		return len(b.F32)
	case DataTypeF64:
		return len(b.F64)
	default:
		return 0
	}
}
815836
func (dsl *DestSmeList) Len() int {
	var ret int
	for i := range dsl.Data {
		ret = ret + dsl.Data[i].Len()
	}
	return ret
}