/// <summary>Initializes the slot.</summary> /// <param name="key">The key.</param> /// <param name="value">The value.</param> internal void InitSlot(RunStateKey key, object value) { var initialized = _stateSlots.TryAdd(key, value); Code.AssertState(initialized, "Attempt to overwrite filled state slot."); }
public object GetSlot(RunStateKey key, Func <object> valueFactory) => _stateSlots.GetOrAdd(key, _ => valueFactory());