// Value returns the last value that was set, or blocks until one
// is received.
165318
func (w *OrderedValue) Value() interface{} {
	w.lock.Lock()

	// If we have a pending value already, use it
	if w.values != nil && w.values.Len() > 0 {
		front := w.values.Front()
		w.values.Remove(front)
		w.lock.Unlock()
		return front.Value
	}

	// No pending value, create a waiter
	if w.waiters == nil {
		w.waiters = list.New()
	}

	var val Value
	w.waiters.PushBack(&val)
	w.lock.Unlock()

	// Return the value once we have it
	return val.Value()
}
1314234
func (s *IncrementStat) Value(delta time.Duration) interface{} {
	s.m.Lock()
	defer s.m.Unlock()
	c := s.c
	s.c = 0
	return float64(c) / delta.Seconds()
}
543923
func (src *JSON) Value() (driver.Value, error) {
	switch src.Status {
	case Present:
		return src.Bytes, nil
	case Null:
		return nil, nil
	default:
		return nil, errUndefined
	}
}
1159845
func (c *Cookie) Value() *String {
	if c.chain.failed() {
		return &String{c.chain, ""}
	}
	return &String{c.chain, c.value.Value}
}
1302850
func (c *Counter) Value() float64 {
	return math.Float64frombits(atomic.LoadUint64(&c.bits))
}
1243923
func (arm *AddressRowMerged) Value() uint64 {
	if arm.AtomsCredit > arm.AtomsDebit {
		return arm.AtomsCredit - arm.AtomsDebit
	}
	return arm.AtomsDebit - arm.AtomsCredit
}
751379
func (src *Float4) Value() (driver.Value, error) {
	switch src.Status {
	case Present:
		return float64(src.Float), nil
	case Null:
		return nil, nil
	default:
		return nil, errUndefined
	}
}
1220897
func (s SequenceNumber) Value() (uint32, error) {
	if s.Last() {
		return 0, fmt.Errorf("This sequence number indicates the last number in the mailbox and does not contain a value")
	}
	if s.Nil() {
		return 0, fmt.Errorf("This sequence number is not set")
	}

	intVal, err := strconv.ParseUint(string(s), 10, 32)
	if err != nil {
		return 0, fmt.Errorf("Could not parse integer value of sequence number")
	}
	return uint32(intVal), nil
}
1058566
func (i Int64) Value() (driver.Value, error) {
	if !i.Valid {
		return nil, nil
	}
	return i.Int64, nil
}
1043378
func (h *Handle) Value() []byte {
	b, err := json.Marshal(h)
	if err != nil {
		return nil
	}
	return b
}
398088
func (pi *PromisedID) Value() (int, error) {
	if *pi == -1 {
		return -1, errors.New("value has not been computed yet")
	}
	return (int)(*pi), nil
}
234782
func (t TimeDefLocal) Value() (driver.Value, error) {
	return t.T.Local(), nil
}
1323424
func (i *tableIter) Value() []byte {
	if i.data == nil {
		return nil
	}
	return i.data.Value()
}
531819
func (w *ComparedValue) Value(k interface{}) interface{} {
	v, val := w.valueWaiter(k)
	if val == nil {
		return v
	}

	return val.Value()
}
353035
func (p *ctx) Value(key interface{}) interface{} {
	if k, ok := key.(string); ok {
		if val, exist := p.ParamOk(k); exist {
			return val
		}
	}

	return p.parent.Value(key)
}
1096117
func (c *Context) Value(key fmt.Stringer) interface{} {
	value := c.values[key]
	return value
}
116930
func (ba BytesArray) Value() (driver.Value, error) {
	if !ba.Valid {
		return nil, nil
	}

	return BytesArrayValue(ba.BytesArray)
}