@@ -204,22 +204,27 @@ here's one possible order of execution:
204204 and runs up to the first ` await ` .
205205 It calls the ` listPhotos(inGallery:) ` function
206206 and suspends execution while it waits for that function to return.
207+
2072082 . While this code's execution is suspended,
208209 some other concurrent code in the same program runs.
209210 For example, maybe a long-running background task
210211 continues updating a list of new photo galleries.
211212 That code also runs until the next suspension point, marked by ` await ` ,
212213 or until it completes.
214+
2132153 . After ` listPhotos(inGallery:) ` returns,
214216 this code continues execution starting at that point.
215217 It assigns the value that was returned to ` photoNames ` .
218+
2162194 . The lines that define ` sortedNames ` and ` name `
217220 are regular, synchronous code.
218221 Because nothing is marked ` await ` on these lines,
219222 there aren't any possible suspension points.
223+
2202245 . The next ` await ` marks the call to the ` downloadPhoto(named:) ` function.
221225 This code pauses execution again until that function returns,
222226 giving other concurrent code an opportunity to run.
227+
2232286 . After ` downloadPhoto(named:) ` returns,
224229 its return value is assigned to ` photo `
225230 and then passed as an argument when calling ` show(_:) ` .
@@ -235,8 +240,10 @@ Because code with `await` needs to be able to suspend execution,
235240only certain places in your program can call asynchronous functions or methods:
236241
237242- Code in the body of an asynchronous function, method, or property.
243+
238244- Code in the static ` main() ` method of
239245 a structure, class, or enumeration that's marked with ` @main ` .
246+
240247- Code in an unstructured child task,
241248 as shown in < doc:Concurrency#Unstructured-Concurrency > below.
242249
0 commit comments