diff --git a/Sources/Instrumentation/Instrument.swift b/Sources/Instrumentation/Instrument.swift index 9747b6f..c80444f 100644 --- a/Sources/Instrumentation/Instrument.swift +++ b/Sources/Instrumentation/Instrument.swift @@ -14,13 +14,10 @@ import ServiceContextModule -/// Typealias used to simplify Support of old Swift versions which do not have `Sendable` defined. -@preconcurrency public protocol _SwiftInstrumentationSendable: Sendable {} - /// Conforming types are used to extract values from a specific `Carrier`. -public protocol Extractor: _SwiftInstrumentationSendable { +public protocol Extractor: Sendable { /// The carrier to extract values from. - associatedtype Carrier + associatedtype Carrier: Sendable /// Extract the value for the given key from the `Carrier`. /// @@ -31,9 +28,9 @@ public protocol Extractor: _SwiftInstrumentationSendable { } /// Conforming types are used to inject values into a specific `Carrier`. -public protocol Injector: _SwiftInstrumentationSendable { +public protocol Injector: Sendable { /// The carrier to inject values into. - associatedtype Carrier + associatedtype Carrier: Sendable /// Inject the given value for the given key into the given `Carrier`. /// @@ -46,7 +43,7 @@ public protocol Injector: _SwiftInstrumentationSendable { /// Conforming types are usually cross-cutting tools like tracers. They are agnostic of what specific `Carrier` is used /// to propagate metadata across boundaries, but instead just specify what values to use for which keys. -public protocol Instrument: _SwiftInstrumentationSendable { +public protocol Instrument: Sendable { /// Extract values from a `Carrier` by using the given extractor and inject them into the given `ServiceContext`. /// It's quite common for `Instrument`s to come up with new values if they weren't passed along in the given `Carrier`. /// diff --git a/Sources/Tracing/SpanProtocol.swift b/Sources/Tracing/SpanProtocol.swift index 5fc6085..50125fe 100644 --- a/Sources/Tracing/SpanProtocol.swift +++ b/Sources/Tracing/SpanProtocol.swift @@ -31,7 +31,7 @@ /// resource that must be started, accumulate all possible information from the span's duration, and ended exactly once. /// /// - SeeAlso: For more details refer to the [OpenTelemetry Specification: Span](https://github.com/open-telemetry/opentelemetry-specification/blob/v0.7.0/specification/trace/api.md#span) which this type is compatible with. -public protocol Span: _SwiftTracingSendableSpan { +public protocol Span: Sendable { /// The read-only `ServiceContext` of this `Span`, set when starting this `Span`. var context: ServiceContext { get } @@ -732,8 +732,6 @@ public struct SpanLink { } } -@preconcurrency public protocol _SwiftTracingSendableSpan: Sendable {} - extension SpanAttributes: Sendable {} extension SpanAttribute: Sendable {} // @unchecked because some payloads are CustomStringConvertible extension SpanStatus: Sendable {} diff --git a/Tests/TracingTests/TracedLockTests.swift b/Tests/TracingTests/TracedLockTests.swift index 439200b..8e4b2a9 100644 --- a/Tests/TracingTests/TracedLockTests.swift +++ b/Tests/TracingTests/TracedLockTests.swift @@ -180,7 +180,5 @@ extension TracedLockPrintlnTracer: Tracer { } } -#if compiler(>=5.6.0) extension TracedLockPrintlnTracer: Sendable {} extension TracedLockPrintlnTracer.TracedLockPrintlnSpan: @unchecked Sendable {} // only intended for single threaded testing -#endif