@@ -16,8 +16,8 @@ import CAtomics
16
16
#warning("We should be able to use atomics in the stdlib when we raise the deployment target to require Swift 6")
17
17
#endif
18
18
19
- public class AtomicBool {
20
- private let atomic : UnsafeMutablePointer < CAtomicUInt32 >
19
+ public final class AtomicBool : Sendable {
20
+ private nonisolated ( unsafe ) let atomic: UnsafeMutablePointer < CAtomicUInt32 >
21
21
22
22
public init ( initialValue: Bool ) {
23
23
self . atomic = atomic_uint32_create ( initialValue ? 1 : 0 )
@@ -37,8 +37,8 @@ public class AtomicBool {
37
37
}
38
38
}
39
39
40
- public class AtomicUInt8 {
41
- private let atomic : UnsafeMutablePointer < CAtomicUInt32 >
40
+ public final class AtomicUInt8 : Sendable {
41
+ private nonisolated ( unsafe ) let atomic: UnsafeMutablePointer < CAtomicUInt32 >
42
42
43
43
public init ( initialValue: UInt8 ) {
44
44
self . atomic = atomic_uint32_create ( UInt32 ( initialValue) )
@@ -58,8 +58,8 @@ public class AtomicUInt8 {
58
58
}
59
59
}
60
60
61
- public class AtomicUInt32 {
62
- private let atomic : UnsafeMutablePointer < CAtomicUInt32 >
61
+ public final class AtomicUInt32 : Sendable {
62
+ private nonisolated ( unsafe ) let atomic: UnsafeMutablePointer < CAtomicUInt32 >
63
63
64
64
public init ( initialValue: UInt32 ) {
65
65
self . atomic = atomic_uint32_create ( initialValue)
0 commit comments