Open bjo0 opened 1 month ago
Just to make sure I understand, are you saying the last sentence is unclear?
Critical sections should always be structured to run synchronously.
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?