-
Notifications
You must be signed in to change notification settings - Fork 36
Mark types Sendable #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8982b6c
to
f335a11
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pushing this. One bigger question and some nits.
Sources/Tracing/Span.swift
Outdated
extension SpanAttributes: Sendable {} | ||
extension SpanAttribute: @unchecked Sendable {} | ||
extension SpanStatus: Sendable {} | ||
extension SpanEvent: @unchecked Sendable {} // unchecked because of DispatchWallTime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is DispatchWallTime used for locking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, for the "wall time" time type. Swift's Clocks are missing functionality and we would have to require 5.7 so sadly it's a no go either way... Though I'm still looking into using Swift's clock types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but why is it "unchecked because of DispatchWallTime
"? Is DispatchWallTime
not marked as Sendable? Shouldn't we use @preconcurrency
in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I just moved to that in e3c5bc1
(#83) :)
6997271
to
c31a43f
Compare
Nailed it now, I think... Last look @fabianfett ? :) |
|
||
#if compiler(>=5.6.0) | ||
extension DynamicTracepointTestTracer: @unchecked Sendable {} // only intended for single threaded testing {} | ||
extension DynamicTracepointTestTracer.TracepointSpan: @unchecked Sendable {} // only intended for single threaded testing {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect the {}
suffix here is unnecessary?
|
||
#if compiler(>=5.6.0) | ||
extension TracedLockPrintlnTracer: Sendable {} | ||
extension TracedLockPrintlnTracer.TracedLockPrintlnSpan: @unchecked Sendable {} // only intended for single threaded testing {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for {}
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, cleaned up!
Resolves #79
cc @fabianfett