Skip to content

Commit c8e0ee5

Browse files
committed
Fix playground
1 parent c9facd2 commit c8e0ee5

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎Demo/SemaphorePlayground.playground/Contents.swift‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ do {
2020
await withThrowingTaskGroup(of: Void.self) { group in
2121
group.addTask {
2222
print("Kid 1 - wait")
23-
try await semaphore.wait()
23+
await semaphore.wait()
2424
print("Kid 1 - wait finished")
2525
try await Task.sleep(nanoseconds: 1_000_000_000) // Kid 1 playing with iPad
2626
semaphore.signal()
2727
print("Kid 1 - done with iPad")
2828
}
2929
group.addTask {
3030
print("Kid 2 - wait")
31-
try await semaphore.wait()
31+
await semaphore.wait()
3232
print("Kid 2 - wait finished")
3333
try await Task.sleep(nanoseconds: 1_000_000_000) // Kid 2 playing with iPad
3434
semaphore.signal()
3535
print("Kid 2 - done with iPad")
3636
}
3737
group.addTask {
3838
print("Kid 3 - wait")
39-
try await semaphore.wait()
39+
await semaphore.wait()
4040
print("Kid 3 - wait finished")
4141
try await Task.sleep(nanoseconds: 1_000_000_000) // Kid 3 playing with iPad
4242
semaphore.signal()
@@ -84,7 +84,7 @@ do {
8484
for i in 0..<15 {
8585
group.addTask {
8686
let songNumber = i + 1
87-
try await semaphore.wait()
87+
await semaphore.wait()
8888
print("Downloading song", songNumber)
8989
try await Task.sleep(nanoseconds: 2_000_000_000) // Download take ~2 sec each
9090
print("Downloaded song", songNumber)

‎Semaphore.xcworkspace/contents.xcworkspacedata‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)