File tree Expand file tree Collapse file tree 1 file changed +1
-27
lines changed Expand file tree Collapse file tree 1 file changed +1
-27
lines changed Original file line number Diff line number Diff line change 29
29
// SOFTWARE.
30
30
//
31
31
32
- #if canImport(Darwin) && compiler(>=6)
32
+ #if compiler(>=6)
33
33
34
34
// Backports the Swift 6 type Mutex<Value> to all Darwin platforms
35
35
@@ -70,32 +70,6 @@ public struct Mutex<Value: ~Copyable>: @unchecked Sendable, ~Copyable {
70
70
}
71
71
}
72
72
}
73
- #elseif compiler(>=6)
74
-
75
- // Use Swift 6 Mutex directly
76
-
77
- import Synchronization
78
- typealias Mutext = Synchronization . Mutex
79
-
80
- public struct Mutex < Value: ~ Copyable> : @unchecked Sendable , ~ Copyable {
81
- private let inner : Synchronization . Mutex < Value >
82
-
83
- public init ( _ initialValue: consuming sending Value) {
84
- self . inner = . init( initialValue)
85
- }
86
-
87
- public borrowing func withLock< Result, E: Error > (
88
- _ body: ( inout sending Value) throws ( E ) -> sending Result
89
- ) throws ( E) -> sending Result {
90
- try inner. withLock ( body)
91
- }
92
-
93
- public borrowing func withLockIfAvailable< Result, E: Error > (
94
- _ body: ( inout sending Value) throws ( E ) -> sending Result
95
- ) throws ( E) -> sending Result? {
96
- try inner. withLockIfAvailable ( body)
97
- }
98
- }
99
73
100
74
#else
101
75
You can’t perform that action at this time.
0 commit comments