Change all variables that are Atomic* types to not be nonisolated(unsafe)

Since the `Atomic*` types can not be marked as `Sendable` (because they aren’t C structs), we can change the variables to constants and can remove `nonisolated(unsafe)`.
This commit is contained in:
Alex Hoppen
2024-06-07 08:49:10 -07:00
parent 76a0db79be
commit c43cffd044
9 changed files with 18 additions and 23 deletions

View File

@@ -19,8 +19,7 @@ import SourceKitLSP
public final class InProcessSourceKitLSPClient: Sendable {
private let server: SourceKitLSPServer
/// `nonisolated(unsafe)` if fine because `nextRequestID` is atomic.
private nonisolated(unsafe) var nextRequestID = AtomicUInt32(initialValue: 0)
private let nextRequestID = AtomicUInt32(initialValue: 0)
/// Create a new `SourceKitLSPServer`. An `InitializeRequest` is automatically sent to the server.
///