func (w *KeyedValue) Init(k string, v interface{}) {
	w.lock.Lock()
	defer w.lock.Unlock()
	_, val := w.valueWaiter(k)
	if val != nil {
		w.setValue(k, v)
	}
}
Init will initialize the key to a given value only if the key has
not been set before. This is safe to call multiple times and in parallel.
package shadow
import (
	"sync"
)
type KeyedValue struct {
	lock    sync.Mutex
	once    sync.Once
	values  map[string]interface{}
	waiters map[string]*Value
	closed  bool
}
func (w *KeyedValue) Close() error {
	w.lock.Lock()
	defer w.lock.Unlock()
	w.closed = true
	for k, val := range w.waiters {
		val.SetValue(ErrClosed)
		delete(w.waiters, k)
	}
	return nil
}
func (w *KeyedValue) Value(k string) interface{} {
	w.lock.Lock()
	v, val := w.valueWaiter(k)
	w.lock.Unlock()
	if val == nil {
		return v
	}
	return val.Value()
}
func (w *KeyedValue) WaitForChange(k string) interface{} {
	w.lock.Lock()
	w.once.Do(w.init)
	if w.closed {
		w.lock.Unlock()
		return ErrClosed
	}
	val := w.waiters[k]
	if val == nil {
		val = new(Value)
		w.waiters[k] = val
	}
	w.lock.Unlock()
	return val.Value()
}
func (w *KeyedValue) ValueOk(k string) (interface{}, bool) {
	w.lock.Lock()
	defer w.lock.Unlock()
	v, val := w.valueWaiter(k)
	return v, val == nil
}
func (w *KeyedValue) SetValue(k string, v interface{}) {
	w.lock.Lock()
	defer w.lock.Unlock()
	w.setValue(k, v)
}