We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 628d046 commit b5f31f9Copy full SHA for b5f31f9
Tests/AllocatedLockTests.swift
@@ -56,16 +56,17 @@ final class AllocatedLockTests: XCTestCase {
56
XCTAssertTrue(value)
57
}
58
59
- @MainActor
60
func testLock_Blocks() async {
61
let lock = AllocatedLock()
62
- lock.unsafeLock()
63
64
- Task {
+ Task { @MainActor in
+ lock.unsafeLock()
65
try? await Task.sleep(nanoseconds: 1_000_000_000)
66
lock.unsafeUnlock()
67
68
+ try? await Task.sleep(nanoseconds: 500_000)
69
+
70
let results = await withTaskGroup(of: Bool.self) { group in
71
group.addTask {
72
try? await Task.sleep(nanoseconds: 5_000_000)
0 commit comments