-
Notifications
You must be signed in to change notification settings - Fork 285
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
Require ThreadSafeBox.T
to be Sendable
#1394
Conversation
@swift-ci Please test |
@swift-ci Please test Linux |
@@ -24,7 +24,7 @@ extension NSLock { | |||
/// A thread safe container that contains a value of type `T`. | |||
/// | |||
/// - Note: Unchecked sendable conformance because value is guarded by a lock. | |||
public class ThreadSafeBox<T>: @unchecked Sendable { |
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.
Out of curiosity, what issues are being caused by it not being Sendable
?
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 think the main issue that I noticed was that some of the request handles in TestSourceKitLSPClient
weren’t sendable. I didn’t technically hit any bug from it but I was wondering why I could modify local variables from the surrounding context from within the request handler, which generally isn’t safe.
ccb571f
to
2446ab4
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
2446ab4
to
5b7d725
Compare
@swift-ci Please test |
Otherwise, I think `ThreadSafeBox` might still have data races. This also requires us to make `TestSourceKitLSPClient.RequestHandler` sendable. rdar://128572489
5b7d725
to
c7bf59e
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
Otherwise, I think
ThreadSafeBox
might still have data races. This also requires us to makeTestSourceKitLSPClient.RequestHandler
sendable.rdar://128572489