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 2929// SOFTWARE.
3030//
3131
32- #if canImport(Darwin) && compiler(>=6)
32+ #if compiler(>=6)
3333
3434// Backports the Swift 6 type Mutex<Value> to all Darwin platforms
3535
@@ -70,32 +70,6 @@ public struct Mutex<Value: ~Copyable>: @unchecked Sendable, ~Copyable {
7070 }
7171 }
7272}
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- }
9973
10074#else
10175
You can’t perform that action at this time.
0 commit comments