Skip to content

Commit a40e28b

Browse files
committed
swift 6
1 parent 26d95c9 commit a40e28b

File tree

4 files changed

+2
-281
lines changed

4 files changed

+2
-281
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -55,33 +55,6 @@ jobs:
5555
- name: Test
5656
run: swift test --skip-build
5757

58-
xcode_15_4:
59-
runs-on: macos-14
60-
env:
61-
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
62-
steps:
63-
- name: Checkout
64-
uses: actions/checkout@v4
65-
- name: Version
66-
run: swift --version
67-
- name: Build
68-
run: swift build --build-tests
69-
- name: Test
70-
run: swift test --skip-build
71-
72-
linux_swift_5_10:
73-
runs-on: ubuntu-latest
74-
container: swift:5.10
75-
steps:
76-
- name: Checkout
77-
uses: actions/checkout@v4
78-
- name: Version
79-
run: swift --version
80-
- name: Build
81-
run: swift build --build-tests
82-
- name: Test
83-
run: swift test --skip-build
84-
8558
linux_swift_6_0:
8659
runs-on: ubuntu-latest
8760
container: swift:6.0.3
@@ -151,15 +124,15 @@ jobs:
151124
- name: Build
152125
run: swift build --swift-sdk aarch64-unknown-linux-android24
153126

154-
windows_swift_6_1:
127+
windows_swift_6_2:
155128
runs-on: windows-latest
156129
steps:
157130
- name: Checkout
158131
uses: actions/checkout@v4
159132
- name: Install Swift
160133
uses: SwiftyLab/setup-swift@latest
161134
with:
162-
swift-version: "6.1.2"
135+
swift-version: "6.2.0"
163136
visual-studio-components: Microsoft.VisualStudio.Component.Windows11SDK.22621
164137
- name: Version
165138
run: swift --version

Package@swift-5.10.swift

Lines changed: 0 additions & 39 deletions
This file was deleted.

Sources/Mutex.swift

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
// SOFTWARE.
3030
//
3131

32-
#if compiler(>=6)
33-
34-
#if !canImport(WinSDK)
35-
3632
// Backports the Swift 6 type Mutex<Value> to all Darwin platforms
3733
@usableFromInline
3834
struct Mutex<Value: ~Copyable>: ~Copyable {
@@ -64,40 +60,6 @@ struct Mutex<Value: ~Copyable>: ~Copyable {
6460

6561
extension Mutex: @unchecked Sendable where Value: ~Copyable { }
6662

67-
#else
68-
69-
// Windows doesn't support ~Copyable yet
70-
71-
@usableFromInline
72-
struct Mutex<Value>: @unchecked Sendable {
73-
let storage: Storage<Value>
74-
75-
@usableFromInline
76-
init(_ initialValue: consuming sending Value) {
77-
self.storage = Storage(initialValue)
78-
}
79-
80-
@usableFromInline
81-
borrowing func withLock<Result, E: Error>(
82-
_ body: (inout sending Value) throws(E) -> sending Result
83-
) throws(E) -> sending Result {
84-
storage.lock()
85-
defer { storage.unlock() }
86-
return try body(&storage.value)
87-
}
88-
89-
@usableFromInline
90-
borrowing func withLockIfAvailable<Result, E: Error>(
91-
_ body: (inout sending Value) throws(E) -> sending Result
92-
) throws(E) -> sending Result? {
93-
guard storage.tryLock() else { return nil }
94-
defer { storage.unlock() }
95-
return try body(&storage.value)
96-
}
97-
}
98-
99-
#endif
100-
10163
#if canImport(Darwin)
10264

10365
import struct os.os_unfair_lock_t
@@ -209,5 +171,3 @@ final class Storage<Value> {
209171
}
210172

211173
#endif
212-
213-
#endif

Sources/MutexSwift5.swift

Lines changed: 0 additions & 173 deletions
This file was deleted.

0 commit comments

Comments
 (0)