internal void EndContext(SpanBuildContextModel model) { lock (contextLock) { if (stack.Peek() != model) { return; } EndContext(); } }
private SpanBuildContext StartContext(Func <Span, IInline> factoryMethod) { lock (contextLock) { if (rootSpanHolder == null) { rootSpanHolder = current; } SpanBuildContextModel model = new SpanBuildContextModel(factoryMethod, current, current.Children.Count, this); SpanBuildContext context = new SpanBuildContext(model); stack.Push(model); current = new Span(); return(context); } }
public ISpanBuilder EndContext() { if (stack.Count < 1) { return(this); } SpanBuildContextModel model = stack.Pop(); model.LockResultSpan(current); current = model.BuildModifieredParent(); if (stack.Count < 1) { rootSpanHolder = null; } return(this); }
internal SpanBuildContext(SpanBuildContextModel model) { this.model = model; model.SetContext(this); builder = model.Builder; }