Skip to content

Commit

Permalink
ref: Add comment why no lock required in scope (#4648)
Browse files Browse the repository at this point in the history
Add a short comment to explain why we don't need to call synchronize
spanLock when building the trace context in SentryScope.applyToEvent.
  • Loading branch information
philipphofmann authored Dec 19, 2024
1 parent e304199 commit 6da2718
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/Sentry/SentryScope.m
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@ - (SentryEvent *__nullable)applyToEvent:(SentryEvent *)event
}
}

// We don't need call synchronized(_spanLock) here because we get a copy of the span in the
// _spanLock above.
newContext[@"trace"] = [self buildTraceContext:span];

event.context = newContext;
Expand Down

0 comments on commit 6da2718

Please sign in to comment.