Skip to content

Commit b5f31f9

Browse files
committed
Fix warning
1 parent 628d046 commit b5f31f9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Tests/AllocatedLockTests.swift

Lines changed: 4 additions & 3 deletions
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)