We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents edb4e4d + a5436b8 commit 27ee366Copy full SHA for 27ee366
Sources/OpenTelemetrySdk/Trace/RecordEventsReadableSpan.swift
@@ -290,14 +290,19 @@ public class RecordEventsReadableSpan: ReadableSpan {
290
}
291
292
public func end(time: Date) {
293
- internalStatusQueue.sync(flags: .barrier) {
+ let alreadyEnded = internalStatusQueue.sync(flags: .barrier) {
294
if internalEnd {
295
- return
296
-
297
- } else {
298
- internalEnd = true
+ return true
299
+
+ internalEnd = true
+ return false
300
301
302
+ if alreadyEnded {
303
+ return
304
+ }
305
306
eventsSyncLock.withLockVoid {
307
attributesSyncLock.withLockVoid {
308
isRecording = false
0 commit comments