Skip to content

Commit

Permalink
Update MigratingTo1.11.md (#3184)
Browse files Browse the repository at this point in the history
Remove unnecessary await
  • Loading branch information
larryonoff authored Jun 18, 2024
1 parent ba82946 commit 9958881
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ To fix this deprecation you can use the new ``Shared/withLock(_:)`` method on th
case .delayedIncrementButtonTapped:
return .run { _ in
@Shared(.count) var count
await $count.withLock { $0 += 1 }
$count.withLock { $0 += 1 }
}
```

Expand All @@ -73,7 +73,7 @@ Technically it is still possible to write code that has race conditions, such as

```swift
let currentCount = count
await $count.withLock { $0 = currentCount + 1 }
$count.withLock { $0 = currentCount + 1 }
```

But there is no way to 100% prevent race conditions in code. Even actors are susceptible to problems
Expand Down

0 comments on commit 9958881

Please sign in to comment.