0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-01 12:16:11 -05:00
This commit is contained in:
Nathan Whitaker 2025-01-31 12:07:07 -08:00
parent 3afc00c30c
commit b83c05620f

View file

@ -4738,6 +4738,16 @@ struct TracingSpan(#[allow(dead_code)] tracing::span::EnteredSpan);
deno_core::external!(TracingSpan, "tracingspan");
fn span_with_context(
state: &State,
span: tracing::Span,
) -> tracing::span::EnteredSpan {
if let Some(context) = &state.context {
span.set_parent(context.clone());
}
span.entered()
}
#[op2(fast)]
fn op_make_span(
op_state: &mut OpState,
@ -4760,7 +4770,7 @@ fn op_exit_span(op_state: &mut OpState, span: *const c_void, root: bool) {
let _span = unsafe { ptr.unsafely_take().0 };
if root {
let state = op_state.borrow_mut::<State>();
state.context.pop();
state.context = None;
}
}