You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the current isolation domain is freed up to perform other work, actor-isolated state may change after an asynchronous call. As a consequence, you can think of explicitly marking potential suspension points as a way to indicate the end of a critical section.
This code assumes, incorrectly, that the island actor’s food value will not change between asynchronous calls. Critical sections should always be structured to run synchronously.
The phrase This code assumes, incorrectly leaves me with a major doubt about what I'm supposed to be taking away from this section. What's the correct way to use suspension points as a way to indicate the end of a critical section?
The text was updated successfully, but these errors were encountered:
The code block and subsequent sentence seem like a non sequitur of the prior sentences.
I was expecting to see an example of how to use explicitly marking potential suspensions points as a way to indicate the end of a critical section. I can see why the code block is problematic; but I'd like to know how to do it correctly.
https://www.swift.org/migration/documentation/swift-6-concurrency-migration-guide/dataracesafety#Atomicity
The phrase
This code assumes, incorrectly
leaves me with a major doubt about what I'm supposed to be taking away from this section. What's the correct way to use suspension points as a way to indicate the end of a critical section?The text was updated successfully, but these errors were encountered: