Skip to content

Commit 66a14c9

Browse files
committed
Fix warning
1 parent b11cd99 commit 66a14c9

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

Sources/AllocatedLock.swift

-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131

3232
// Backports the Swift interface around os_unfair_lock_t available in recent Darwin platforms
3333
//
34-
@available(iOS, deprecated: 16.0, message: "use OSAllocatedUnfairLock directly")
35-
@available(tvOS, deprecated: 16.0, message: "use OSAllocatedUnfairLock directly")
36-
@available(watchOS, deprecated: 9, message: "use OSAllocatedUnfairLock directly")
37-
@available(macOS, deprecated: 13.0, message: "use OSAllocatedUnfairLock directly")
3834
public struct AllocatedLock<State>: @unchecked Sendable {
3935

4036
@usableFromInline

Tests/AllocatedLockTests.swift

+4-3
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,17 @@ final class AllocatedLockTests: XCTestCase {
5656
XCTAssertTrue(value)
5757
}
5858

59-
@MainActor
6059
func testLock_Blocks() async {
6160
let lock = AllocatedLock()
62-
lock.unsafeLock()
6361

64-
Task {
62+
Task { @MainActor in
63+
lock.unsafeLock()
6564
try? await Task.sleep(nanoseconds: 1_000_000_000)
6665
lock.unsafeUnlock()
6766
}
6867

68+
try? await Task.sleep(nanoseconds: 500_000)
69+
6970
let results = await withTaskGroup(of: Bool.self) { group in
7071
group.addTask {
7172
try? await Task.sleep(nanoseconds: 5_000_000)

0 commit comments

Comments
 (0)