Skip to content

Commit 43d313e

Browse files
committed
test
1 parent f720a4d commit 43d313e

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

Sources/Mutex.swift

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
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

0 commit comments

Comments
 (0)